Really ugly error . . . any ideas?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
Gatesunder
Posts: 120
Joined: Sat Feb 09, 2008 11:24 pm UTC
Location: KSU

Really ugly error . . . any ideas?

Postby Gatesunder » Wed Apr 02, 2008 1:24 pm UTC

So basically I am getting this error and I have no clue why. I do know where it's coming from though, but still that doesn't give me any ideas. This is more of an abstract art kind of thing I think . . . Look at it and tell me what you think it represents. Link error? most likely . . . or maybe just an alien cooking recipe . . . you decide . . .

Spoiler:
SudokuSolution.cpp:78: error: no match for ‘operator<<’ in ‘((std::basic_ostream<char, std::char_traits<char> >*)std::cout.std::basic_ostream<_CharT, _Traits>::operator<< [with _CharT = char, _Traits = std::char_traits<char>](((const void*)((void*)newNode))))->std::basic_ostream<_CharT, _Traits>::operator<< [with _CharT = char, _Traits = std::char_traits<char>](std::endl [with _CharT = char, _Traits = std::char_traits<char>]) << ((const Move*)newNode->Node<T>::getData [with T = Move]())->Move::print()’
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:67: note: candidates are: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>& (*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:78: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ios<_CharT, _Traits>& (*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:90: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:241: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:264: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:102: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:125: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:157: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:183: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:215: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:288: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:311: note: std::basic_ost


Spoilered for, wtf-ness . . . there was more but I think this is enough . . .

(P.S. I have no clue what to search for on this one so if there is already a post on this feel free to tell me . . .
I'm wrong 99% of the time, but some day that 1% will be better than the rest ...

User avatar
evilbeanfiend
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Re: Really ugly error . . . any ideas?

Postby evilbeanfiend » Wed Apr 02, 2008 1:39 pm UTC

may i suggest http://www.bdsoft.com/tools/stlfilt.html to make it look less scary.

its not a linker error (that would complain about undefined symbols) its more likely you have missed including a header, or have forgotten to even declare the operator<< for one of your classes in the right scope? or didnt get one of the types right? (though it should be more than just a const error as gcc give a specific error about discarding const quailfiers)

these are just guesses, didn't look at exactly what the problem was cos it hurt my neyes.
in ur beanz makin u eveel

User avatar
und3rdark
Posts: 27
Joined: Mon Jan 14, 2008 7:25 pm UTC
Location: Canton, Michigan

Re: Really ugly error . . . any ideas?

Postby und3rdark » Wed Apr 02, 2008 4:46 pm UTC

Could you please post the relevant lines of code causing this problem (around line 78)?

It looks like your trying to do something to a stream that doesn't exist or is in the wrong namespace.
"The impulse to discriminate is a feature of our brains. We look for patterns and make decisions based on them. Sometimes the patterns are illusions, and we come to irrational conclusions."
-Scott Adams

zahlman
Posts: 638
Joined: Wed Jan 30, 2008 5:15 pm UTC

Re: Really ugly error . . . any ideas?

Postby zahlman » Wed Apr 02, 2008 7:37 pm UTC

SudokuSolution.cpp:78: error: no match for ‘operator<<’


"You didn't tell me how to do this..."

‘((std::basic_ostream<char, std::char_traits<char> >*)std::cout.std::basic_ostream<_CharT, _Traits>::operator<< [with _CharT = char, _Traits = std::char_traits<char>](((const void*)((void*)newNode))))->std::basic_ostream<_CharT, _Traits>::operator<< [with _CharT = char, _Traits = std::char_traits<char>](std::endl [with _CharT = char, _Traits = std::char_traits<char>]) << ((const Move*)newNode->Node<T>::getData [with T = Move]())->Move::print()’


"here: std::cout (which is an ostream) << newNode (which is a pointer, which I implicitly cast to void* for my own reasons) << std::endl << newNode->getData()->print() (where newNode is a Node<Move>*, and its getData() returns a Move*, which I implicitly cast to be const)".

The code to output the pointer and the std::endl is fine, but something is wrong with trying to output the result of the print() call. What is the type of the thing you return from print()? Whatever it is, it's not currently printable.

Also, strongly consider learning about const correctness and using it.

Everything else


"Here are all the things I do know how to put on the right hand side of the << when the left-hand side is an ostream: an ostream manipulator, a generic stream manipulator, an even more generic stream manipulator, all kinds of integer types, ..."
Belial wrote:I once had a series of undocumented and nonstandardized subjective experiences that indicated that anecdotal data is biased and unreliable.

Tac-Tics
Posts: 536
Joined: Thu Sep 13, 2007 7:58 pm UTC

Re: Really ugly error . . . any ideas?

Postby Tac-Tics » Wed Apr 02, 2008 7:44 pm UTC

The error was using C++ =-P

C++ Template errors have a lower signal to noise ratio than the smallest nontrivial subnetwork of the Internet.

coppro
Posts: 117
Joined: Mon Feb 04, 2008 6:04 am UTC

Re: Really ugly error . . . any ideas?

Postby coppro » Wed Apr 02, 2008 11:04 pm UTC

Tac-Tics wrote:The error was using C++ =-P

C++ Template errors have a lower signal to noise ratio than the smallest nontrivial subnetwork of the Internet.
We're all holding our breath for concepts already.

User avatar
Gatesunder
Posts: 120
Joined: Sat Feb 09, 2008 11:24 pm UTC
Location: KSU

Re: Really ugly error . . . any ideas?

Postby Gatesunder » Thu Apr 03, 2008 2:36 am UTC

For the most part I wasn't really looking for help on this one as much as I was just posting the ugliest error I had ever had. Even so, I generally have found this error to be caused by lack of sleep or constipation. Code wise? I was trying to cout a void function. Thanks for the consideration though and I DEFINITELY appreciate that error translator from post number 2. I didn't so much like the insults coming from post number 4.

As a parting gift, before I go back to work on this program (while drunk, let's see what errors I get this time), here's a nice little bit of segfault that I felt particularly proud of and annoyed with at the same time.

Spoiler:
*** glibc detected *** ./test: double free or corruption (out): 0x09c17b90 ***
======= Backtrace: =========
/lib/libc.so.6[0x82aac1]
/lib/libc.so.6(cfree+0x90)[0x82e0f0]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x1c46f1]
./test[0x8049463]
./test[0x804971c]
./test[0x8049ab0]
./test[0x804a417]
./test[0x804d0c9]
/lib/libc.so.6(__libc_start_main+0xe0)[0x7d7390]
./test(__gxx_personality_v0+0x4d)[0x8048911]
======= Memory map: ========
00110000-00111000 r-xp 00110000 00:00 0 [vdso]
00111000-001f1000 r-xp 00000000 fd:01 2167032 /usr/lib/libstdc++.so.6.0.8
001f1000-001f5000 r-xp 000df000 fd:01 2167032 /usr/lib/libstdc++.so.6.0.8
001f5000-001f6000 rwxp 000e3000 fd:01 2167032 /usr/lib/libstdc++.so.6.0.8
001f6000-001fc000 rwxp 001f6000 00:00 0
007a2000-007bd000 r-xp 00000000 fd:00 133144 /lib/ld-2.7.so
007bd000-007be000 r-xp 0001a000 fd:00 133144 /lib/ld-2.7.so
007be000-007bf000 rwxp 0001b000 fd:00 133144 /lib/ld-2.7.so
007c1000-00914000 r-xp 00000000 fd:00 133145 /lib/libc-2.7.so
00914000-00916000 r-xp 00153000 fd:00 133145 /lib/libc-2.7.so
00916000-00917000 rwxp 00155000 fd:00 133145 /lib/libc-2.7.so
00917000-0091a000 rwxp 00917000 00:00 0
0091c000-00943000 r-xp 00000000 fd:00 133150 /lib/libm-2.7.so
00943000-00944000 r-xp 00026000 fd:00 133150 /lib/libm-2.7.so
00944000-00945000 rwxp 00027000 fd:00 133150 /lib/libm-2.7.so
00cea000-00cf5000 r-xp 00000000 fd:00 133154 /lib/libgcc_s-4.1.2-20070925.so.1
00cf5000-00cf6000 rwxp 0000a000 fd:00 133154 /lib/libgcc_s-4.1.2-20070925.so.1
09c17000-09c38000 rw-p 09c17000 00:00 0
b7e00000-b7e21000 rw-p b7e00000 00:00 0
b7e21000-b7f00000 ---p b7e21000 00:00 0
b7f1c000-b7f1e000 rw-p b7f1c000 00:00 0
b7f39000-b7f3a000 rw-p b7f39000 00:00 0
bfce1000-bfcf6000 rw-p bffea000 00:00 0 [stack]
Aborted

This was probably the most painful thing my computer ever experienced aside from that time I plugged in the power cord and the outlet caused a power drain or something that basically screwed with my computer.
I'm wrong 99% of the time, but some day that 1% will be better than the rest ...

User avatar
evilbeanfiend
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Re: Really ugly error . . . any ideas?

Postby evilbeanfiend » Thu Apr 03, 2008 8:58 am UTC

coppro wrote:
Tac-Tics wrote:The error was using C++ =-P

C++ Template errors have a lower signal to noise ratio than the smallest nontrivial subnetwork of the Internet.
We're all holding our breath for concepts already.


in the mean time stlfilt helps enormously, trolling about language choice doesn't ;)
in ur beanz makin u eveel

User avatar
segmentation fault
Posts: 1770
Joined: Wed Dec 05, 2007 4:10 pm UTC
Location: Nu Jersey
Contact:

Re: Really ugly error . . . any ideas?

Postby segmentation fault » Thu Apr 03, 2008 1:41 pm UTC

it looks like whatever youre passing to << cant do <<
people are like LDL cholesterol for the internet

zahlman
Posts: 638
Joined: Wed Jan 30, 2008 5:15 pm UTC

Re: Really ugly error . . . any ideas?

Postby zahlman » Thu Apr 03, 2008 10:48 pm UTC

Tac-Tics wrote:The error was using C++ =-P

C++ Template errors have a lower signal to noise ratio than the smallest nontrivial subnetwork of the Internet.


Er, I would argue that signal to noise ratio goes down with increasing subnetwork size. Two people talking to each other are vastly more coherent than, say, 4chan.
Belial wrote:I once had a series of undocumented and nonstandardized subjective experiences that indicated that anecdotal data is biased and unreliable.

zahlman
Posts: 638
Joined: Wed Jan 30, 2008 5:15 pm UTC

Re: Really ugly error . . . any ideas?

Postby zahlman » Thu Apr 03, 2008 10:49 pm UTC

zahlman wrote:
Tac-Tics wrote:The error was using C++ =-P

C++ Template errors have a lower signal to noise ratio than the smallest nontrivial subnetwork of the Internet.


Er, I would argue that signal to noise ratio goes down with increasing subnetwork size. Two people talking to each other are vastly more coherent than, say, 4chan.


Gatesunder wrote:For the most part I wasn't really looking for help on this one as much as I was just posting the ugliest error I had ever had. Even so, I generally have found this error to be caused by lack of sleep or constipation. Code wise? I was trying to cout a void function. Thanks for the consideration though and I DEFINITELY appreciate that error translator from post number 2. I didn't so much like the insults coming from post number 4.


Er, what insults? Instead of linking you to an error translator, I took it in hand to translate the error manually.
Belial wrote:I once had a series of undocumented and nonstandardized subjective experiences that indicated that anecdotal data is biased and unreliable.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Really ugly error . . . any ideas?

Postby Berengal » Fri Apr 04, 2008 9:31 am UTC

zahlman wrote:Er, what insults? Instead of linking you to an error translator, I took it in hand to translate the error manually.

Try: s/post/reply/
Gatesunder wrote:I didn't so much like the insults coming from reply number 4.


You're post/reply 3. 4 was
Tac-Tics wrote:The error was using C++ =-P

C++ Template errors have a lower signal to noise ratio than the smallest nontrivial subnetwork of the Internet.


At least, that makes much more sense to me :)
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
Hammer
Because all of you look like nails.
Posts: 5491
Joined: Thu May 03, 2007 7:32 pm UTC
Contact:

Re: Really ugly error . . . any ideas?

Postby Hammer » Fri Apr 04, 2008 11:03 am UTC

Gatesunder wrote:For the most part I wasn't really looking for help on this one as much as I was just posting the ugliest error I had ever had.

Given that help is not actually wanted and that this thread is not going anywhere good...Locked.
"What's wrong with you mathematicians? Cake is never a problem."


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 7 guests