Hi, I'm a C++ novice and keep getting this compiler error.
"In file included from Blah.cpp"
.. for the following piece of code
The code and filenames seem correct. Am I doing something stupidly wrong?Code:#include "Blah.h"
Thanks
sammacs
Hi, I'm a C++ novice and keep getting this compiler error.
"In file included from Blah.cpp"
.. for the following piece of code
The code and filenames seem correct. Am I doing something stupidly wrong?Code:#include "Blah.h"
Thanks
sammacs
Seems to me its indicating an error in that included file.
Are you sure there is nothing else it says about the error (presumably it'll say what the error is)?
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
Hi,
Yer the actual error is this line in "Blah.h"(actually called TextEditorApp.h):
It says "ISO C++ forbids defining types within return type" and "syntax error before '&' token".Code:DECLARE_APP(TextEditorApp)
Please help,
thanks,
Sam
We'll need to see more of the file than that one line of code. Is that a function declaration, definition, or call? You might just need a semicolon at the end of the line, but I can't really tell from that piece of code.
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
Hi,
here are the two relevant files. There are also two other files in the project.
TextEditorApp.h
TextEditorApp.cppCode:#ifndef TEXTEDITORAPP_H #define TEXTEDITORAPP_H class TextEditorApp : public wxApp { public: //Initialise the application virtual bool OnInit(); } DECLARE_APP(TextEditorApp) #endif //TEXTEDITORAPP_H
Thanks for the help,Code:#include <wx/wx.h> #include "TextEditorApp.h" #include "TextFrame.h" IMPLEMENT_APP(TextEditorApp) bool TextEditorApp::OnInit() { TextFrame *frame = new TextFrame("Simple Text Editor", 100, 100, 400, 300); frame->Show(TRUE); SetTopWindow(frame); return true; }
$am
Code:#ifndef TEXTEDITORAPP_H #define TEXTEDITORAPP_H class TextEditorApp : public wxApp { public: //Initialise the application virtual bool OnInit(); }; // <--- Semi-colon here DECLARE_APP(TextEditorApp) #endif //TEXTEDITORAPP_H
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
Yep that was the problem, thanks a lot.
It really annoys me that I don't spot simple mistakes like that.
Thanks again,
Sam