User forums > Help

won't compile, even defualt console.

<< < (2/2)

avgprogramerjoe:
Yes i followed his advice, and i tried the defualt console application with the target being console application, etc.
It comes down to the fact that I can't get

--- Code: ---#include <iostream>

int main()
{
std::cout << "Hello world!" << std::endl;
return 0;
}

--- End code ---
to work. I can't get anything to work, it's not just the gui applications.
For the hello world build log I got:

--- Quote ---Switching to target: default
mingw32-g++.exe    -L"C:\Program Files\CodeBlocks\lib" -o "C:\Documents and Settings\Owner.YOUR-99DDF15D27\My Documents\myprograms\console.exe" .objs\main.o         -lSDL -lSDL_image -lSDLmain
C:\Program Files\CodeBlocks\lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
 
--- End quote ---
I have, however noticed that it compiles fine when I click compile, but if I click build I get the message above.

Any help will be greatly appreciated,

Joe

P.S. sorry it took me so long, I got restricted from the computer for a bit....

MortenMacFly:

--- Quote from: avgprogramerjoe on September 12, 2007, 11:07:10 pm ----lSDL -lSDL_image -lSDLmain

--- End quote ---
Remove those libraries from the linker settings of your project and it will certainly work.
With regards, Morten.

Navigation

[0] Message Index

[*] Previous page

Go to full version