Sign in to follow this  
Bijo

Using MS Visual C/C++ command line compiler w/ SDL

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Meh, there's something about IDEs I don't like, I don't know what it is. I just detest them, but maybe I should just forget about it and start using one. A simple text editor and a command-line compiler just feel a lot better.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this