I'm using Visual Studio 2012, managed C++, to make a bridge between a third party SDK and our system which is written in C#. I have succesfully wrapped and consumed several functions from said SDK. Except one, which only result in a Unresolved External Error.
The SDK's header file defines the function's signature:
#if defined WIN32
#if defined BUILD_ADS_SHARED_LIB
#define ADS_LINK_SPEC __declspec (dllexport)
#define ADS_CALLING_CONVENTION __stdcall
#elif defined USE_ADS_SHARED_LIB
#define ADS_LINK_SPEC __declspec (dllimport)
#define ADS_CALLING_CONVENTION __stdcall
#else
#define ADS_LINK_SPEC
#define ADS_CALLING_CONVENTION
#endif
#else
#define ADS_LINK_SPEC
#define ADS_CALLING_CONVENTION
#endif
DatabaseResult ADS_LINK_SPEC ADS_CALLING_CONVENTION
createDatabase(
const Settings& settings, Artec::SdkDatabase::iDatabase *& instance);
The error says:
Error 10 error LNK2028: unresolved token (0A000089) "enum Artec::SdkDatabase::DatabaseResult __cdecl Artec::SdkDatabase::createDatabase(class Artec::SdkDatabase::Settings const &,class Artec::SdkDatabase::iDatabase * &)" (?createDatabase@SdkDatabase@Artec@@$$FYA?AW4DatabaseResult@12@ABVSettings@12@AAPAViDatabase@12@@Z) referenced in function "private: static enum Artec::SdkDatabase::DatabaseResult __clrcall Broadway3dWrapper::Broadway3dWrapper::GetConn(wchar_t const *,wchar_t const *,wchar_t const *,wchar_t const *,char const *,class Artec::SdkDatabase::iDatabase * &)" (?GetConn@Broadway3dWrapper@1@$$FCM?AW4DatabaseResult@SdkDatabase@Artec@@PB_W000PBDAAPAViDatabase@34@@Z) C:\bioap\tfs\Identitum\Dev\src\BA.Identitum.Devices.Broadway3d\Broadway3dWrapper.obj BA.Identitum.Devices.Brodway3D
So it's looking for the mangled name:
?createDatabase@SdkDatabase@Artec@@$$FYA?AW4DatabaseResult@12@ABVSettings@12@AAPAViDatabase@12@@Z
Making a little dumpbin on the referenced dll, I found there is in fact a function called like that exported, thing is the name is mangled slightly different:
?createDatabase@SdkDatabase@Artec@@YG?AW4DatabaseResult@12@ABVSettings@12@AAPAViDatabase@12@@Z
Can anyone help me here? I cannot contact the SDK vendor, and I'm completely lost here.