User forums > Using Code::Blocks
Whenever I add a class I get "Undefined reference to WinMain"
BlueHazzard:
Yop, here it is:
--- Code: ----------------- Build: Debug in tmp4 (compiler: GNU GCC Compiler)---------------
[ 33.3%] mingw32-g++.exe -Wall -fexceptions -g -Wno-unused-local-typedefs -I -c G:\tmp\tmp4\main.cpp -o obj\Debug\main.o
[ 66.7%] mingw32-g++.exe -Wall -fexceptions -g -Wno-unused-local-typedefs -I -c G:\\tmp\tmp4\test.cpp -o obj\Debug\test.o
[100.0%] mingw32-g++.exe -o bin\Debug\tmp4.exe obj\Debug\main.o obj\Debug\test.o
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
Process terminated with status 0 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Build log saved as:
--- End code ---
And yes it is the -I option.... don't know why it is there... and why saving helps, but someone has fixed it in trunk...
[Edit:] saving project is not enough , you have to re open it, so the parser checks for plausibility...
oBFusCATed:
Hm, thanks good to know it is fixed:)
Navigation
[0] Message Index
[*] Previous page
Go to full version