8

I have a C++ driver I'm trying to compile, and it has this line in the code:

#import "msado15.dll" no_namespace rename("EOF", "EndOfFile")

But when I compile the project, I get the error:

Error 1 fatal error C1083: Cannot open type library file: 'msado15.dll': No such file or directory

I have the DLL, but where do I put it so that the compiler can see it?

demonplus
  • 5,613
  • 12
  • 49
  • 68
Craig Shearer
  • 14,222
  • 19
  • 64
  • 95

6 Answers6

19

You can place the DLL in the same path as the referencing file (.h) as you have done, alternatively you can modify the additional include paths for the LIB section of your project(s). In VC++ this will be:

Project | Properties | Configuration Properties | Linker | General | Additional Library Directories

This method can be useful if you are centralizing third party dependencies and you don't want to be forced to keeping the referenced file (.h) and DLL in sync via the same path.

See this MSDN link for further details.

Henk
  • 1,704
  • 10
  • 12
  • It's been a while since I did C++, but as a I recall, you shouldn't need to copy the DLLs. It should all be handled through the configuration properties as stated above shouldn't it? Anyway, since this is the only answer that even mentions the properties ... +1. – John MacIntyre Jan 06 '09 at 00:53
  • Here is how I resolved it -> Reference the directory containing the DLL in you VS project : Tools -> option -> Directories -> Executable files -> (path to your DLLs) – PlanetUnknown Jun 12 '12 at 17:25
3

For VC++2010(VS2010): the compiler is not able to see the msado15.dll
which is located at C:\Program Files\Common Files\System\ado

Go to Project | Properties | Configuration Properties | VC++ Directories and add the following at executable directories

$(CommonProgramFiles)\System\ado;

You should be fine

Ramakrishna Talla
  • 1,011
  • 12
  • 7
2

This may be a little out of date for most people, however - for Visual Studio 2008, for a particular

Project |
Configuration Properties |
C/C++ |
Additional Include Directories |

Select and click on the ellipsis (...).

Add the directory

C:\Program Files\Common Files\System\ado

and move it to the bottom of the list using the arrows.

declanh
  • 86
  • 9
0

Try to set "Delayed DLL loading" (or an option similar) in 'Project Properties'->'Linker'->'input' section of your VC++ project.

Fabry
  • 1
0

OK, found it by reading the documentation. I just had to put it in the same folder as the referenced file (which was in a different location to the project source code).

Craig Shearer
  • 14,222
  • 19
  • 64
  • 95
0

You need to have library files and function definition headers to do this. If you happen to don't have them, you would try dynamic loading of DLL using LoadLibrary and GetProcAddress, pointers for linking functions.