I'm trying to compile on Windows a project usually running on MacOSX. I have a makefile and I would like to use it on Windows too. The thing is that I don't understand this error:
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../lib/libcygwin.a(libcmain.o): In function `main':
/usr/src/debug/cygwin-2.11.2-1/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain'
/usr/src/debug/cygwin-2.11.2-1/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x7f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status
make: *** [makefile:70: program] Error 1
The compilation command was:
g++ -o program path/to/a/lot/of/obj/obj.o -lGLEW -lGLU -lGL -lSDL2main -lSDL2
There's a similar topic Undefined reference to WinMain in Cygwin but the solution didn't help me. My makefile works fine on MacOSX.