Q:

Undefined Reference to WinMain@16 When Compiling SDL_ttf?

I am trying to compile SDL_ttf with MinGW and Code::Blocks. I have imported the MSVC Solution to Code::Blocks, There were three projects.

SDL_ttf
showfont
glfont

the SDL_ttf project compiled fine after adding the SDL headers to the path and linking with SDL.a. Now whenever I try to compile glfont or showfont I get:
undefined reference to `WinMain@16`

From the SDL FAQ I understood that this problem may occur when you do not link with SDLmain.a, so I linked with it, but I'm still getting the error. Any suggestions? I'm completely lost.

A:

The problem seems similar to something you encounter in MSVS, in that you have to declare the main function as:
int _tmain(int argc, _TCHAR* argv[])

or
int wmain(int argc, _TCHAR* argv[])

The environment tries to call this function and not main() and since you haven't implemented it, the linking error occurs.

