undefined reference to `WinMain@16'

前端 未结 6 2271
花落未央
花落未央 2020-11-21 06:46

When I try to build a program using Eclipse CDT, I get the following:

/mingw/lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined r

6条回答
  •  逝去的感伤
    2020-11-21 07:26

    I was encountering this error while compiling my application with SDL. This was caused by SDL defining it's own main function in SDL_main.h. To prevent SDL define the main function an SDL_MAIN_HANDLED macro has to be defined before the SDL.h header is included.

提交回复
热议问题