using dll from another object

LuckyLucks used Ask the Experts™

I wanted to use a dll from another project. However this project is external to the visual studio solution that I am currently working on.  It has however been compiled on the same machine.

can i just throw the dll in the executable directory and start using it?

What's the difference between building it/not building it (conceptually)?  I am afraid I do not understand symbols very well.  Would different builds give different symbols for the same functions?

"@jkr  if you decide to use the DLL from the other project: Open the project in Visual Studio and build it. This will create the DLL and a .lib file of the same name. Add that .lib file (the so called "import library") to your project (either by right clicking on your project in the "Solution" tree view or your project's properties under "Linker|Additional libraries" and copy the DLL to your executable's directory to use it and rebuild your project as well."
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
However this project is external to the visual studio solution that I am currently working on.  

the external dll has at least 3 components:

1. a header file which you can include such that calls to the library compile
2. a dll file which was used at runtime and need to be avilable either by putting into same folder as your own executable, or put path to PATH environment, or put dll into system32 (or SysWow64) folder.
3. a static library which has compiled wrapper functions which call into the dll.

you simply have to add the static library to linker input modules and the unresolved externals are resolved.

if the dll could not found at runtime, your program would not start but complain missing dll by error code 126.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial