我靜態鏈接fw.lib
在我C++/CLI
項目,並得到這些錯誤:靜態鏈接庫文件會導致鏈接錯誤
Error 1 error LNK2028: unresolved token (0A00001B) "extern "C" unsigned int __cdecl func(unsigned int,unsigned char *)" ([email protected]@[email protected]) referenced in function "public: static void __clrcall Sdk::Native::Method(void)" ([email protected]@[email protected]@$$FSMXXZ) C:\project\Sdk.obj Sdk
Error 2 error LNK2019: unresolved external symbol "extern "C" unsigned int __cdecl func(unsigned int,unsigned char *)" ([email protected]@[email protected]) referenced in function "public: static void __clrcall Sdk::Native::Method(void)" ([email protected]@[email protected]@$$FSMXXZ) C:\project\Sdk.obj Sdk
我該怎麼辦錯了嗎?我這樣做:
- 添加在lib路徑[項目屬性 - >庫目錄]
- 新增
fw.lib
下的文件[項目屬性 - >附加依賴] - 裹
fw.h
所有功能與extern "C" {...}
任何想法?