[問題] LNK2001 無法解析的外部符號

作者: s501082001 (曹草逼)   2015-12-21 10:28:14
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
error LNK2001: 無法解析的外部符號
"public: void __cdecl caffe::Net<float>::CopyTrainedLayersFrom(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >)"
(?CopyTrainedLayersFrom@?$Net@M@caffe@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
C:\deep learning\caffe-vs2013-master\test-MNIST\test-MNIST.obj test-MNIST
error LNK2001: 無法解析的外部符號
"public: static void __cdecl
caffe::Caffe::SetDevice(int)" (?SetDevice@Caffe@caffe@@SAXH@Z) C:\deep
learning\caffe-vs2013-master\test-MNIST\test-MNIST.obj test-MNIST
程式碼(Code):(請善用置底文網頁, 記得排版)
補充說明(Supplement):
在執行專案編譯時會產生此問題,環境變數有加入需要使用到的程序路徑,
ex boost檔案 環境變數 =>變數名稱:BOOST_1_56_0 變數值:C:\local\boost_1_56_0
再"屬性"裡面,連結器中的"輸入"再相依性裡面則是把boost檔案裡面的lib檔都加進去了
目前在執行的程序是有關機器學習的東西,有用到像是OPENCV,BOOST,CUDA等程序
作者: LPH66 (-6.2598534e+18f)   2015-12-21 19:29:00
這看起來是你的專案內部的東西 (namespace caffe)去看一下你的專案設定裡有沒有所有東西都加進去編譯了特別檢查訊息中的那兩個函式所在的檔案有沒有加
作者: s501082001 (曹草逼)   2015-12-21 20:42:00
再相依性的部分有將下載的檔案(ex boost_1_56_0)內部的lib檔全部加到專案裡的連結器的"其他相依性"裡面,如果加入完就會出現無法解析外部如果沒加入相關lib檔則會說缺少boost_xx.lib某個內部的檔案有確認將library庫的檔案加進去

Links booklink

Contact Us: admin [ a t ] ucptt.com