[問題] Undefined reference, symbol error問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
CentOS
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
#include "tbb/concurrent_hash_map.h"
#include "tbb/blocked_range.h"
#include "tbb/parallel_for.h"
問題(Question):
跑的程式碼如下
https://gist.github.com/anonymous/d4da3b91772e7418163e
我已經將tbb做成symbol link到
/usr/include
/usr/lib
/usr/lib64
這三個目錄下了,但執行
g++ hashtabletest.cpp -o hashtabletest
後會吐出一大片錯誤畫面,如下:
http://i.stack.imgur.com/u44w5.png

這怎麼辦才好?拜託大家救救我
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.236.76.109
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1458627330.A.AF3.html
→
03/22 14:20, , 1F
03/22 14:20, 1F
有例子嗎?第一次碰到這問題 O_Q
※ 編輯: henry8168 (36.236.76.109), 03/22/2016 14:21:54
→
03/22 14:25, , 2F
03/22 14:25, 2F
我加上lib的路徑後,出現如下畫面:
http://imgur.com/C3ppnVM.png

※ 編輯: henry8168 (36.236.76.109), 03/22/2016 14:38:53
→
03/22 14:54, , 3F
03/22 14:54, 3F
library底下有好幾個檔案,我每個都嘗試去link,但都出現差不多的訊息,
一樣cannot find
http://imgur.com/md48HkG.png

拜託,能解決的話我願意付200P
※ 編輯: henry8168 (36.236.76.109), 03/22/2016 15:02:35
→
03/22 15:40, , 4F
03/22 15:40, 4F
→
03/22 15:40, , 5F
03/22 15:40, 5F
原來如此,我成功讓它找到library了!
但是又接著出現新的問題: http://imgur.com/bmfMaMD.png

※ 編輯: henry8168 (36.236.76.109), 03/22/2016 15:51:25
最後讓我自問自答,會出現我最後一張圖的問題,
是因為我的程式碼裡沒有main() function。
謝謝樓上兩位,已發給兩位各100P,記得確認^^
※ 編輯: henry8168 (36.236.76.109), 03/22/2016 16:33:47
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章