I need to compile my project from Linux to Windows. It''s not hard task, because I''v used SDL and OpenGL. Everything compiles well, but can''t find out what''s problem withlinking!
Undefined reference to ''WinMain@16'' must be very common error :doubt:
I have int main(int argc, char *argv[]) in one of my source cpp''s.
Could anyone tell from experience the problem is where?
I''v already fought with this proble three hours, gotta rest now a little
Here something I think might help:
#makefile
CC=g++
INCLUDE=-I/usr/include -I/usr/include/freetype2 -L../gamelibrary -L/gcc-2.95.2/i386-mingw32msvc/lib
LIBS= -lgamelibrary -lopengl32 -lglu32 -lSDL -lfreetype
%.o : %.cpp
$(CC) $(INCLUDE) -c -o $@ $<
test: test.o terrain.o
$(CC) $^ -o test.exe $(LIBS) $(INCLUDE) -s
clean :
rm *.o
all : clean test
C:\Omat tiedostot\Stefan\prog\test_1>make
g++ test.o terrain.o -o test.exe -lgamelibrary -lopengl32 -lglu32 -lSDL -lfreetype -I/usr/include -I/usr/include/freetype2 -L../gamelibrary -L/gcc-2.95.2/i386-mingw32msvc/lib -s /gcc-2.95.2/i386-mingw32msvc/lib\libmingw32.a(main.o)(.text+0x8e): undefined reference to `WinMain@16''
MAKE.EXE: *** [test] Error 1
I installed gcc package I found link in cone3d.gamedev.net.
Thanks for any help