Results 1 to 1 of 1
Howdy there. thanks in advance.
I'm working on a school assignment (simple binary tree implementation), but i'm getting very weird compiler errors. I've looked all around the forums and on ...
- 02-16-2009 #1Just Joined!
- Join Date
- Feb 2009
- Posts
- 1
C++ templating - reference errors
Howdy there. thanks in advance.
I'm working on a school assignment (simple binary tree implementation), but i'm getting very weird compiler errors. I've looked all around the forums and on the net but can't find anything that seems to help.
Part of the actual error is here:
Fiddiling around with the bst.h and bst.cpp (combining the two, throwing them both in driver, etc.) i get different messages, but they all relate to 'undefined reference'.Code:driver.cpp:(.text+0x1ba): undefined reference to `bst<float>::bst()' driver.cpp:(.text+0x1d7): undefined reference to `std::cout' driver.cpp:(.text+0x1dc): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(bool)' driver.cpp:(.text+0x1f1): undefined reference to `bst<float>::~bst()' driver.cpp:(.text+0x211): undefined reference to `bst<float>::~bst()' driver.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0' bst.o: In function `__static_initialization_and_destruction_0(int, int)': bst.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()' bst.o: In function `__tcf_0': bst.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()' bst.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
Inside my main is what causes the problem (i comment it out, the problem goes away).
Thanks a lot in advance.Code:int main() { bool mybool; int theInt = 5; bst<int> theTree(); theTree.print(); menu(); return 0; }


Reply With Quote