c:/program files/codeblocks/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
Process terminated with status 1 (0 minutes, 7 seconds)
1 errors, 0 warnings (0 minutes, 7 seconds)

Make sure you select "Console Application" in your project's configurations. The WinMain function that is missing from your code is the "main" function that is expected from a GUI Win32 application. If you select "console" application, it should be looking for the "main()" function, which I presume you have defined in your "main.c" file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.