Good evening ladies and gentlemen..
This is the first time I have tried to download source from the web and compile it myself. This is also the first time I'm building a relatively large project on the command line..
I'm using Visual Studio 2012's cl.exe tool to build. I've pushed through a number of errors so far but this one's been bugging me for a few days. The project compiles fine but it won't link. It complains of the entry point not being defined:
LINK1561: entry point must be defined.
I've checked that the main.cpp file is being built and checked that there is a valid main function inside. I'm pretty sure it has something to do with the project depending on SDL. If it matters, I'm not sure I'm using the same version of SDL that the code was written for. A few years back I was writing small games with SDL and I have vague memories of it being very picky with regards to entry points. You had to link to SDLmain.lib and define the main function with all command line argument arguments.
Here's my super sexy home grown makefile:
CC=comp.bat SRC_SOURCE=*.cpp SRC_HEADER=*.h SRC_INC_1=C:\DevLib\SDL_1.2\SDL-1.2.15\include SRC_INC_2=C:\DevLib\SDL_1.2\SDL_image-1.2.12\include LIB_PATH_1=C:\DevLib\SDL_1.2\SDL-1.2.15\lib\x86 LIB_PATH_2=C:\DevLib\SDL_1.2\SDL_image-1.2.12\lib\x86 LIB_PATH_3=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib; LIB=SDL.lib SDLmain.lib SDL_image.lib all: $(SRC_SOURCE) $(SRC_HEADER) $(CC) $(SRC_SOURCE) /I$(SRC_INC_1) /I$(SRC_INC_2) /EHsc /link SDLmain.lib SDL.lib SDL_image.lib /LIBPATH:"$(LIB_PATH_1)" /LIBPATH:"$(LIB_PATH_2)" clear: del *.obj del *.exe
As i'm sure you'll notice, not all of my LIB_PATH macros are being used. Some of them are scars from previous struggles..
Here is comp.bat: (I found this online somewhere)
@echo on :: Load compilation environment call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" :: Invoke compiler with any options passed to this batch file "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe" %*
Please tell me if there's any vital info I have omitted. All help is appreciated, thanks.