This may be occur if you install GCC but not the w32api and mingw-runtime packages. The MinGW installer (e.g. MinGW-3.1.0-1.exe) includes all the basic packages you need: GCC, binutils, w32api, mingw-runtime and mingw32-make. See http://www.mingw.org/download.shtml.