我在fw.lib
项目中静态链接C++/CLI
,并收到以下错误:
Error 1 error LNK2028: unresolved token (0A00001B) "extern "C" unsigned int __cdecl func(unsigned int,unsigned char *)" (?func@@$$J0YAIIPAE@Z) referenced in function "public: static void __clrcall Sdk::Native::Method(void)" (?Method@Native@Sdk@@$$FSMXXZ) C:\project\Sdk.obj Sdk
Error 2 error LNK2019: unresolved external symbol "extern "C" unsigned int __cdecl func(unsigned int,unsigned char *)" (?func@@$$J0YAIIPAE@Z) referenced in function "public: static void __clrcall Sdk::Native::Method(void)" (?Method@Native@Sdk@@$$FSMXXZ) C:\project\Sdk.obj Sdk
我做错了什么?我这样做了:
fw.lib
个文件附加依赖] fw.h
extern "C" {...}
中包含所有功能
有什么想法吗?
答案 0 :(得分:-1)
问题解决了......
显然,当您将x64位链接到x32项目(反之亦然)时,链接器会产生非常一般的链接错误。
仅供参考: - )