Using MS Visual C/C++ command line compiler w/ SDL
I don't have time to look so long on the net and finding all these vague or unclear answers (been doing it for an hour or more). I'll put it down for you easy: I've downloaded Visual C++ only for the compiler which I use with my command prompt... not at all do I use the package for the IDE.
Now, my problem is that typical one with the linker that I've seen a lot when searching for answers on the net: LNK1561 fatal error; entry point must be defined.
I've set up things correctly as far as I know (copied DLL to system32 directory, etc., etc.), so I'll cut to the chase (but if you need more info, just ask and I'll give it to ya... here's what I do in the raw sense: cl -Ic:\sdl\include mymain.cpp
cl: the compiler .exe
-I: to specify the include path of SDL
mymain.cpp: source file
It looks like you're not linking with the sdl libs...the command line should be something along the lines of:
cl -I"path\to\sdl\include" mymain.cpp /link /libpath:"path\to\sdl\lib" sdl.lib sdlmain.lib
I'm not sure if that command is exactly right, but it should be close.
Edit: You might also need /SUBSYSTEM:WINDOWS after /link, not sure.
cl -I"path\to\sdl\include" mymain.cpp /link /libpath:"path\to\sdl\lib" sdl.lib sdlmain.lib
I'm not sure if that command is exactly right, but it should be close.
Edit: You might also need /SUBSYSTEM:WINDOWS after /link, not sure.
Thanks for the reply. I'd actually tried that one out too, but it doesn't work either. Been hammering the thing too long, possible good-looking variations, so I switched back to MinGW/g++, but I get even more errors there, hah hah :)
Thanks still. I'll give it a shot later.
Thanks still. I'll give it a shot later.
Why are you using the command line compiler? The Microsoft Visual C++ Express Edition is free as well.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement