User forums > Using Code::Blocks

transfer from visual to code::blocks

(1/1)

dolth:
int main()
{
    return 0;
}

class test        //line 6
{                   //line 7
   int i;   
};

'runs' fine in visual
in code::blocks i get:
G:\mijnspel\final\game\main.c|6|error: syntax error before "test"|
G:\mijnspel\final\game\main.c|7|error: syntax error before '{' token|
||=== Build finished: 2 errors, 0 warnings ===|

What am I missing?

oBFusCATed:
C++ comments in C code  :lol:  :P

btw, not a  C::B question

MortenMacFly:

--- Quote from: dolth on February 10, 2010, 01:49:56 pm ---What am I missing?

--- End quote ---
Don't compile C++ code with a C compiler. If you develop in C++, choose the right file extension like *.cpp, not *.c this is C.

Topic clocked anyways as it violates our forum rules (not related to Code::Blocks itself, but general programming).

Navigation

[0] Message Index

Go to full version