Reputation: 378
I have inherited an old VC++ project that requires an old proprietary .lib file to link against. I have the header file for the lib, but the original developers seem to have lost the .lib file.
I did find a DLL file that I believe a driver from this software package uses that has the same name as the .lib and .h file. I followed these instructions: http://adrianhenke.wordpress.com/2008/12/05/create-lib-file-from-dll/
With that, I was able to generate a .lib file that as far as I know, contains the exact same functions as the .h file I have (the intermediate DEF file shows this). The first project was able to build and link against it successfully, but a second project I have that makes use of the library built by the first project fails to link complaining about unresolved symbols for the functions in the DLL I'm trying to use:
error LNK2019: unresolved external symbol _ncb_receive_wait@12 referenced in function "public: int __thiscall PLC::Write(unsigned short,void *,unsigned short)" (?Write@PLC@@QAEHGPAXG@Z)
I'm trying to understand if this is even possible to do? (Grab an old DLL file, generate a lib from it, link against it and use the DLL file?)
Upvotes: 2
Views: 842
Reputation: 53
I know that this answer is too late for the original question, but hopefully it might help others with a similar problem googling for a solution:
I had a similiar problem linking to an old DLL from Visual C++. I also went down the route of creating a def file and then creating a new lib file from this def file. Then to resolve a linkage error with Visual C++ trying to link to a mangled function name, I manually edited the EXPORTS section of the def file to create a function name alias, along the lines of:
_ncb_receive_wait@12 = ncb_receive_wait
Upvotes: 1