Author Topic: transfer from visual to code::blocks  (Read 2985 times)

dolth

  • Guest
transfer from visual to code::blocks
« on: February 10, 2010, 01:49:56 pm »
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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: transfer from visual to code::blocks
« Reply #1 on: February 10, 2010, 02:21:42 pm »
C++ comments in C code  :lol:  :P

btw, not a  C::B question
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: transfer from visual to code::blocks
« Reply #2 on: February 10, 2010, 02:47:03 pm »
What am I missing?
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).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ