Linking problems with DLL |
Post Reply |
Author | |
kkoster
Newbie Joined: 23 December 2004 Status: Offline Points: 1 |
Post Options
Thanks(0)
Posted: 23 December 2004 at 2:27pm |
I have created an import lib, using LIB, from a DLL for which I don't have the source. The exports are as follows:
2 _Excel4 3 _Excel4v 4 _LPenHelper 1 _XLCallVer There are 11 public symbols in the import lib: 4 _Excel4 5 _Excel4v 6 _LPenHelper 7 _XLCallVer 1 __IMPORT_DESCRIPTOR_XLCALL32 2 __NULL_IMPORT_DESCRIPTOR 4 __imp__Excel4 5 __imp__Excel4v 6 __imp__LPenHelper 7 __imp__XLCallVer 3 ⌂XLCALL32_NULL_THUNK_DATA I declare the the function within an extern "C" block as: __declspec(dllimport) int __stdcall Excel4v(int xlfn, LPXLOPER operRes, int count, LPXLOPER opers[]); When I attempt to link the object files that are consuming this declaration I get the following linker error: error LNK2019: unresolved external symbol __imp__Excel4v@16 referenced in function "public: static bool __cdecl XL::ExcelAddIn::abort(bool)" (?abort@ExcelAddIn@XL@@SA_N_N@Z) The symbol appears to have an "@16" appended on it when it is formed in the C++ module where it is consumed. Any constructive ideas on how to get around this? |
|
abbasmsa
Newbie Joined: 15 May 2007 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
On top of your source code, after the include statements, just add the following lines:
// dummy functions for XLCall32.lib int far pascal Excel4v(int xlfn, LPXLOPER operRes, int count, LPXLOPER far opers[]) { return 1; } int far _cdecl Excel4(int xlfn, LPXLOPER operRes, int count,... ) { return 1; } |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |