Code::Blocks Forums

User forums => Help => Topic started by: wever on August 30, 2014, 11:49:26 pm

Title: undefined reference to `WinMain@16'
Post by: wever on August 30, 2014, 11:49:26 pm
I got this error:

Code
mingw32-g++.exe -LC:\PROGRA~1\AMDAPP~1\lib\x86\ -o bin\Debug\Gaussian_with_OpenCL.exe obj\Debug\args.o obj\Debug\bitmap.o obj\Debug\gaussian.o   C:\PROGRA~1\AMDAPP~1\lib\x86\OpenCL.lib W:\___NEW~1\GAUSSI~1\GAUSSI~2\refu.dll C:\PROGRA~1\AMDAPP~1\lib\x86\OpenCL.lib W:\___NEW~1\GAUSSI~1\GAUSSI~2\refu.dll
p:/programy/programování/codeblocks_32bit/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status


I am using gcc and main function. On stackoverflow somebody suggested to use -mwindows option but 1) I did not find what does this do 2) I cannot find out where should I place this option or how you configure the options for compiler in code blocks. Help pls
Title: Re: undefined reference to `WinMain@16'
Post by: oBFusCATed on August 31, 2014, 12:25:16 am
Project -> properties -> build targets -> Type set it to native or gui...
If it doesn't work (I'm not a windows user anymore) search the forum for sollutions...
Title: Re: undefined reference to `WinMain@16'
Post by: wever on August 31, 2014, 09:52:37 am
I made it working. It was because there was not created main script, so the main function was missing.