Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: denisco on January 10, 2009, 05:28:24 pm
-
I made first a simple project using the new gtk project...
At this point build fine and everything.
when I add my own code of C++ "something .cpp" the compiler treath C++ "class" as an error?
I made a C++ console app to see what would be different
beside the `pkg-config gtk+-2.0 --cflags` and -fexception
what do I have to do here?
-
Hi,
could it be that Gtk is C and you are trying to use a C++ construct by using class?
And could you add some code please to understand the matter better?
Regards
nausea
-
First of all I do have that project with GTK mix C and C++, build and worked fine.
Now I am trying to convert that project into codeblocks and it complains at
class CSize {
int w, h;
};
/home/denisco/workspace/iWebBrowser/WinXDef.h|444|error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘CSize’|
Hope that helps.
-
Just a few guesses at cause.
Guess 1:
Code::Blocks assumes all files with extension .c is an C file.
Change extension to cpp if doing C++ and does it change error?
Guess 2:
In header, add an line of
class CSize;
before using CSize.
This assumes CSize is not defined in header before errors.
Guess 3:
That the name CSize is already used somewhere in an header; if so change name.
Tim S
-
Just a few guesses at cause.
Enough help.
denisco: Mind not posting questions not related to C::B? This violates our forum rules in case you don't know.
Topic locked.