Now that I’ve gotten SDL 1.3 compiling under Visual Studio 2010, I’d like to create my own SDL-based projects. I’m wondering how to do this properly. I come from the Mac world, where you just duplicate projects or use “Project Templates” in XCode. All very easy.
Googling for this, I found this:
http://www.cs.uregina.ca/Links/class-info/405/WWW/Lab1/SDL/properties.html
but I’m guessing this is rather old. Do you still need to edit Properties and link against all these libs?
SDLmain.lib sdl.lib opengl32.lib glu32.lib
You need SDLmain.lib and sdl.lib
You only need the other 2 if you’re doing OpenGL stuff
As an alternative you can use #pragma comment(lib, “SDL”) and #pragma comment(lib, “SDLmain”) in one of your .cpp files and as long as they’re in the lib path, it will build fine. Not sure how portable this is.
At runtime, you’ll need SDL.dll either in your environment path or in your $(targetdir) - you can accomplish the latter with a post build event or hand copy.
-VijayOn Mon, Oct 31, 2011 at 02:52:07PM -0700, VernJensen wrote:
Now that I’ve gotten SDL 1.3 compiling under Visual Studio 2010, I’d like to create my own SDL-based projects. I’m wondering how to do this properly. I come from the Mac world, where you just duplicate projects or use “Project Templates” in XCode. All very easy.
Googling for this, I found this:
Welcome to the Department of Computer Science | Computer Science, University of Regina
but I’m guessing this is rather old. Do you still need to edit Properties and link against all these libs?
SDLmain.lib sdl.lib opengl32.lib glu32.lib
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
I think I’ve gotten it working. I did it by duplicating the project for testgl, moving it to a new directory, and then re-adding SDL.lib and SDLmain.lib to the project (so the references would work again).
Once I got it running this way, I tried removing the above references, and linking against the four files I mentioned in my original message. That seems to work too.