21 Jul
2003
21 Jul
'03
02:11
On Sunday 20 July 2003 20:19, Philipp Thomas wrote:
In your case, try linking like this:
g++ -o haha Kelas.o coba.o
and it should succeed :)
Hi, I just tried your suggestion, but it still fail to link: cincai@nus-cincaipatron:/tmp> g++ -o haha Kelas.o coba.o coba.o(.text+0x18): In function `main': : undefined reference to `Kelas<int>::Kelas[in-charge]()' coba.o(.text+0x32): In function `main': : undefined reference to `Kelas<int>::getInt() const' collect2: ld returned 1 exit status OTOH, if I modified Kelas.h to: ==================== #ifndef KELAS_H #define KELAS_H class Kelas { ... }; #include Kelas.cpp #endif =================== I can compile coba.cpp with just g++ -o haha coba.cpp -- -- Verdi March --