2012-12-26 146 views
0

靜態鏈接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" {...}

任何想法?

回答

-1

問題解決了......

顯然,當你鏈接,例如,64位到X32項目(反之亦然?),鏈接產生很一般鏈接錯誤。

供參考:-)