I use Visual Studio 2012, managed by C ++, to bridge between a third-party SDK and our system, which is written in C #. I successfully wrapped and used several functions from the mentioned SDK. Except for one, which will only lead to an unresolved external error.
The header SDK file defines the signature of the function:
#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 he is looking for a lawsuit name:
?createDatabase@SdkDatabase@Artec@@$$FYA?AW4DatabaseResult@12@ABVSettings@12@AAPAViDatabase@12@@Z
Having done a bit of dumpbin in the reference dll, I discovered that there really is a function called as exported, the thing is a slightly distorted name:
?createDatabase@SdkDatabase@Artec@@YG?AW4DatabaseResult@12@ABVSettings@12@AAPAViDatabase@12@@Z
Can someone help me here? I can not contact the seller of the SDK, and I am completely lost here.