作者ephesians (ephesians)
看板Programming
标题Re: [问题] undefined reference to ..
时间Wed Apr 4 14:53:44 2007
※ 引述《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