I am on Windows XP. Here is the code.
========================
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
Ok that code is correct and in fact is the GNU GCC default C code for MingW too. This is the default that comes with Code::Blocks to begin with. So your code is obviously correct because it compiles just fine. However Cygwin, even from my past experience, just plain never worked right. Its why I moved over to MingW.
However, if your just NEEDING to stick with Cygwin, you might have to actually look at the Cygwin website to see if it has dependencies that you potentially could be missing for your Cygwin install.
The list of KNOWN compilers taken from the official Wiki for Code::Blocks is :
Supported compilers
GNU GCC (incl. G77) (Linux)
MinGW GCC (incl. G77) (Win32)
MSP430 GCC (Win32)
TriCore GCC (Win32, Linux)
PowerPC GCC (Win32, Linux)
Apple GCC (Xcode) (Mac OS X)
Microsoft Visual C++ Toolkit 2003 (Win32)
Microsoft Visual C++ 2005 (Win32)
Borland's C++ Compiler 5.5 (Win32)
DigitalMars C/C++ (Win32)
OpenWatcom (Win32)
Intel C++ compiler (Win32)
Small Device C Compiler (SDCC)
Digital Mars D
GDC D Compiler
LLVM D Compiler