[問題] 編譯cpp檔發生未定義參考
參考網頁:http://caffe.berkeleyvision.org/installation.html
電腦配備:Intel Xeon CPU E5-2620 @ 2.00GHz
GeForce GTX 950 / PCIe
64位元
底下有用分隔線,分隔線以上在說明是說明環境的建置,如果大家覺得文字太多可以
直接從分隔線以下開始看,因為怕文字說明太少,看不懂我在問甚麼,文字太多還請見諒
目前我依照上述的網頁來設定環境,從Ubuntu guide依序安裝了
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev
libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install python-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
再來從https://developer.nvidia.com/cuda-downloads灌CUDA7.5的檔案
也確認了套件有安裝進去
opencv 從官網下載2.4.10版,opencv設定好後有去run內部的samples/c檔
確認ok,將環境都做好設定
__________________________________________________________________________
目前要做http://caffe.berkeleyvision.org/gathered/examples/imagenet.html
網頁的步驟,然後目前要編譯一個" convert_imageset.cpp "將它轉成執行檔
為了將影像資料轉換caffe格式
編譯是用 gcc來編譯
然後編譯成objectfile檔是沒有問題的(gcc -c convert_imageset.cpp)
覺得應該不是標頭檔的問題
然後要編譯執行檔時" gcc convert_imageset.o -o convert_imageset " ,
會出現下面的錯誤
convert_imageset.cpp(.text+0x21):
未定義參考到「google::LogMessageFatal::LogMessageFatal(char const*,int)」
convert_imageset.cpp(.text_0x116):
未定義參考到「std::basic_string<char, std::char_traits<char>, std::allocator<char>」
然後google查詢後,有測試用gcc convert_imageset.o -I /usr/include -l /usr/lib
-o convert_imageset 將lib檔位置引入進來,發現錯誤沒解決,想請問未定義參考
的問題,是不是因為函式庫的部分還有哪裡沒有引入到,還是因為它linker不到程式庫?
麻煩解惑了,如果問得不清楚在麻煩跟我說,謝謝
註:只有編譯一個convert_imageset.cpp檔案,然後有先將caffe-master資料夾用make
指令做編譯,確認沒有問題
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.125.46.75
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1453907156.A.00F.html
推
01/27 23:09, , 1F
01/27 23:09, 1F
→
01/27 23:55, , 2F
01/27 23:55, 2F
→
01/28 00:05, , 3F
01/28 00:05, 3F
→
01/28 00:16, , 4F
01/28 00:16, 4F
→
01/28 00:17, , 5F
01/28 00:17, 5F
→
01/28 00:21, , 6F
01/28 00:21, 6F
推
01/28 00:32, , 7F
01/28 00:32, 7F
→
01/28 00:32, , 8F
01/28 00:32, 8F
→
01/28 00:33, , 9F
01/28 00:33, 9F
→
01/28 00:40, , 10F
01/28 00:40, 10F
→
01/28 01:12, , 11F
01/28 01:12, 11F
→
01/28 01:13, , 12F
01/28 01:13, 12F
→
01/28 01:14, , 13F
01/28 01:14, 13F
→
01/28 01:14, , 14F
01/28 01:14, 14F
→
01/28 01:14, , 15F
01/28 01:14, 15F
→
01/28 01:38, , 16F
01/28 01:38, 16F
→
01/28 01:40, , 17F
01/28 01:40, 17F
→
01/28 01:41, , 18F
01/28 01:41, 18F
→
01/28 01:41, , 19F
01/28 01:41, 19F
推
01/28 02:02, , 20F
01/28 02:02, 20F
→
01/28 02:46, , 21F
01/28 02:46, 21F
→
01/28 09:23, , 22F
01/28 09:23, 22F
→
01/28 21:29, , 23F
01/28 21:29, 23F
→
01/28 21:30, , 24F
01/28 21:30, 24F
→
01/28 21:33, , 25F
01/28 21:33, 25F