11-09-2004, 07:52 AM | #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 |
11-09-2004, 11:17 PM | #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 |
|
|