static libraries and dlls VC++ with VS2005

Started by
3 comments, last by Evil Steve 16 years ago
Hi i am so exhausted from this thing. I have a project which was developed with VC6, so i convert it to VS2005. But there was some errors about some functions that became useless in VS2005 (like _export in VC6 become __declspec(dllexport) in VS2005). This problem (conversion errors) is resolved. But the main problem is that when i debug the project, the .exe could not found a specific dll (ICE_API.dll) but it is building successfully because it reads functions from a static library (ICE_API.lib) and there is the header file (ICE_API.h). But i cannot export the functions that exists in the header file because i cannot read them from the static library. So its not about dllexport or something because when we use __declspec(dllexport) we have to write the function by myself which i cannot because this function exists in the static library (ICE_API.lib). Please it passed a week and i am trying to build a dll file by using the static library so the functions this (lib file) will be exported to the dll without knowing how these functions (that their names are declared this ICE_API.h) are written. Thank You. [Edited by - nammour on April 2, 2008 4:26:50 AM]
Advertisement
I'm not sure I understand. If you have a dependency on a DLL - ICE_API.dll in this case - you should just ship it with your executable. Have you tried placing the relevant dll in the same folder as your executable?
NextWar: The Quest for Earth available now for Windows Phone 7.
If you have a .lib file for VC6, you need a different .lib file for VC2005. As far as I know they aren't compatible.

Also, as Sc4Freak said, you can't pull the functions out of ICE_API.dll and into your own DLL if that's what you're trying to do.
This is all a little bit confused, I'm not entirely sure what you're trying to do... If you have the header containing the function prototypes then it should be a trivial matter to convert them to the updated syntax. Don't forget that you use __declspec(dllexport) to EXPORT functions from a DLL and __declspec(dllimport) to IMPORT functions back in from a DLL. Also, if your app can't find the DLL it may be a search path problem.

Quote:Also, as Sc4Freak said, you can't pull the functions out of ICE_API.dll and into your own DLL if that's what you're trying to do.

Actually there's a tool around called DLL to Lib that'll get you halfway to achieving that.

Jans.
Quote:Original post by Jansic
Quote:Also, as Sc4Freak said, you can't pull the functions out of ICE_API.dll and into your own DLL if that's what you're trying to do.

Actually there's a tool around called DLL to Lib that'll get you halfway to achieving that.
Interesting, I didn't know about that. I knew it was possible (Although extremely ugly, since it's pulling the DLL apart) to get the contents of one DLL into another, I didn't think DLL -> lib was possible.

This topic is closed to new replies.

Advertisement