![]() |
#1
|
|||
|
|||
![]()
[color=#000000:post_uid0]What's wrong with this code?
[b:post_uid0]ZStreamable.hpp[/b:post_uid0] [code:1:post_uid0]namespace zilla { class ZStreamable; } std::ostream& operator<<(std::ostream& out, const zilla::ZStreamable& obj); // line 13 namespace zilla { class ZStreamable { public: ZStreamable (); virtual ~ZStreamable (); virtual void render (std::ostream &out) const = 0; friend std::ostream& operator<<(std::ostream& out, const zilla::ZStreamable& obj); // line 23 }; }[/code:1:post_uid0] [b:post_uid0]PageFooter.hpp[/b:post_uid0] [code:1:post_uid0]namespace zilla { class PageFooter : public ZStreamable { public: virtual void render (std::ostream &out) const; }; }[/code:1:post_uid0] [b:post_uid0]index.cgi.cpp[/b:post_uid0] [code:1:post_uid0]// other code, main, etc etc cout << PageFooter (); // line 72 // mode code[/code:1:post_uid0] [b:post_uid0]make[/b:post_uid0] [code:1:post_uid0]g++ -g -Wall -pedantic -ansi -lcgicc index.cgi.cpp HTTPHTMLCharsetHeader.o XHTMLDoctype.o PageFooter.o ZStreamable.o -o index.cgi index.cgi.cpp: In function `int main(int, char**)': index.cgi.cpp:72: ambiguous overload for `std::ostream& << zilla::PageFooter' operator ZStreamable.hpp:13: candidates are: std::ostream& operator<<(std::ostream&, const zilla::ZStreamable&) ZStreamable.hpp:23: std::ostream& zilla::operator<<(std::ostream&, const zilla::ZStreamable&) ZStreamable.hpp:23: std::ostream& zilla::operator<<(std::ostream&, const zilla::ZStreamable&)[/code:1:post_uid0][/color:post_uid0] |
#2
|
|||
|
|||
![]()
[color=#000000
![]() Line: 176 Error: Unterminated String Constant Now if I had some clue on how to use C++, I'd know what that would mean...but my programming is limited to Visual Basic and Java. I figure that the error will be fixed when everything flips back to forwards which is the inverse of the backwards way became when the calender flipped forwards from yesterday to today, and will be rectified when the calender flips forward to the...[okay, you get the picture]. :smile: EDIT: Did I mention that I only know a very limited amount of Java?[/color ![]()
__________________
Godfather of the wifflebat mafia. Bears are crazy, they\'ll bite your head off if you\'re wearing steak on it. |
#3
|
|||
|
|||
![]()
[color=#000000
![]() Unterminated string constant means you didn't close a string somewhere.[/color ![]() |
#4
|
||||
|
||||
![]()
[color=#000000
![]() ![]() ![]()
__________________
My 5MV webpages My novel fivers list Yup “There must have been a point in early human history when it was actually advantageous to, when confronted with a difficult task, drop it altogether and go do something more fun, because I do that way too often for it to be anything but instinct.” -- Isto Combs |
#5
|
|||
|
|||
![]()
[color=#000000:post_uid0]Actually, I've already copy/pasted the function definition into the friend definition, and removed unnnecessary scopes. Didn't help any. I think my use of friend is just wrong, but it looks right.[/color:post_uid0]
|
#6
|
||||
|
||||
![]()
[color=#000000
![]() ![]() |
#7
|
|||
|
|||
![]()
[color=#000000
![]() ![]() ![]() Besides which I've switched back to cgicc::MStreamable instead of my custom ZStreamable, because I was able to work out my issues from that.[/color ![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|