Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 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
j0hnb is offline  
Old 11-09-2004, 05:34 PM   #2 (permalink)
MXL
Tilted
 
Location: Maryland
Show the the code in question.
MXL is offline  
Old 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.
n0nsensical is offline  
Old 11-10-2004, 08:18 AM   #4 (permalink)
Junkie
 
What nonsensical is basically saying is put it as a global function in your header file (not part of the class) and then make that function a friend of your class to get private access.
Rekna is offline  
 

Tags
error


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 12:10 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54