![]() |
![]() |
#1 (permalink) |
Crazy
Location: Arnold, MD
|
[c++] What's this error?
What does this error mean?
Undefined first referenced symbol in file operator<<(std::basic_ostream<char, std::char_traits<char> >&, Diamond&)/var/tmp//ccR39vYu.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status I'm trying to overload the << operator within a class, and this is the only part that I can't seem to get working. Let me know if you need more code or if you know what I should check out to fix it. Thanks |
![]() |
![]() |
#3 (permalink) |
Junkie
Location: San Francisco
|
It's a linker error meaning operator<< with those parameters is not defined. Remember that if you're trying to do something like
Class c; cout << c; the operator<< function must either be a member of ostream or a global function. If you make it a member of Class it's not going to work the way you expect. |
![]() |
Tags |
error |
|
|