tags:

views:

1786

answers:

4

Hi

I'm an extreme VC++ newbie. 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?

TIA

Craig

+1  A: 

Best way to know which you've obviously didn't try is is trial and error.
Usually it would the the project or solution directory.

shoosh
Well I tried a little, but not enough obviously! Thanks for the answer anyway :)
Craig Shearer
A: 

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
Good old RTFM. http://en.wikipedia.org/wiki/RTFM
Mark Ransom
Shouldn't post/accept your own answer when Henk's said the same....
Tony
OK, agreed, though Henk's response came in after I'd answered my own question. However, I've accepted his answer now.
Craig Shearer
+4  A: 

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
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
A: 

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.