CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2008
    Posts
    6

    how to include .lib and .dll?

    hello,

    i'm using VC++ 2005 and I have 3 files I was given in order to implement a project. These files are a .lib, a .dll and a .h

    In order to get things started and not loosing too much time with it, I decided to start a win32 console application, just to see it working and then take bigger steps.

    In the project properties->Linker->Input I added the .lib file.

    In the cpp file I made the include of the .h file.

    Do I have to do something with the .dll?

    This is the first time I need to add an external library like this to a project. I have used Winsock and other stuff without any problems. What do I need to do in order to be able to access these functions? I still haven't figured out what's the "trick".

    The only readable information I have is on the .h file i was given and the declaring of the functions looks something like this:
    _declspec(dllexport) Name_of_Function();

    Can someone give me a hand please?

    best regards

    Carlos

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: how to include .lib and .dll?

    If you put the dll in the working directory of the built program you should be fine. Alternatively, add its location to your PATH environment variable.

  3. #3
    Join Date
    Jan 2003
    Location
    Timisoara, Romania
    Posts
    306

    Re: how to include .lib and .dll?

    One additional point, did you add .h file to your project?
    On the other hand, witch is your current issue? As Lindley said the simple .dll copy in the build folder it's enough to use that .dll file.

  4. #4
    Join Date
    Dec 2008
    Posts
    6

    Re: how to include .lib and .dll?

    hello,

    first of all, thanks for your replies.

    the issue is that, when I call the functions of the .h file, I can't compile as they are considered as non existant. Do you think that putting the DLL into the build folder is enough solve this?

    bottom line is: I can't compile when I call a function present on the .h file.

    Is there any particular way of calling those functions? I ask this because they are declared in a way which is not familiar to me.

    thanks again!

    Carlos

  5. #5
    Join Date
    Jan 2003
    Location
    Timisoara, Romania
    Posts
    306

    Re: how to include .lib and .dll?

    Please, show us your IDE output window content. We need it for a quickly understand of your issues.

  6. #6
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: how to include .lib and .dll?

    Since dlls are linked at runtime, nothing the compiler or linker says to you at build time could possibly be related to the dll. It's more likely an issue with the lib.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured