Re: [問題] undefined reference to ..

看板Programming作者 (ephesians)時間18年前 (2007/04/04 14:53), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/4 (看更多)
※ 引述《kornelius (Kornelius)》之銘言: : 我在 hashmap.h 內定義 : 然後在 hashmap.cpp 內實做 : 主程式寫在 hashtest2.cpp : 然後編譯,卻出現這樣的 bug ,一直想不透是什麼問題...搞了好久啊啊啊 Orz : 也檢查過,也沒有忘了實做的函數 : $ g++ hashtest2.cpp hashmap.cpp -o test : /tmp/ccKWvjRU.o: In function `main': : hashtest2.cpp:(.text+0x9a): undefined reference to `HashMap<int, : int>::HashMap()' 我在做類似的事情,我的處理法是: g++ -c hashmap.cpp g++ -o test hashtest2.cpp -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.112.226.125
文章代碼(AID): #164qjvWn (Programming)
文章代碼(AID): #164qjvWn (Programming)