Sign in to follow this  
Oglethorpe

Newb needing help (tutorial 1)

Recommended Posts

SETUP QUESTIONS: 1. I'm using VC7 and I was wondering if there was a way to setup the linking so that I dont have to type:
#ifdef WIN32
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")
#endif
at the begining of all my sdl programs, as far as I can tell the menu has changed in vc7 so i couldnt follow the instructions where I read them.

Share this post


Link to post
Share on other sites
You can either

A) Pragma the libs into every project

or

B) Link them from the settings for every project.

Really not much of a difference - except that the pragmas make it explicit in the source which libs your project needs, so that, though the pragma's themselves aren't portable, it'll be a lot easier for someone else to get up and running in a different IDE.

Share this post


Link to post
Share on other sites
okay, i suggest not using pragma

download the sdl includes and lib files.
create a folder called API/SDL/
in the SDL folder dump all the files there.
go to "Tools">"Options">"Projects">"VC++ Directories"
you will then see a drop down menu that says executable files.
go to includes and libs, and link the url to the API/SDL file

after that is done, go to Projects on the top menu, then go to propreties
Under C/C++>>code generator, change "Single-threaded Debug (/MLd)" to "Multi-threaded DLL (/MD)"
then go to linkers under command lines type "sdl.lib sdlmain.lib"
place SDL.dll to your project folder to run it.

Share this post


Link to post
Share on other sites
Sign in to follow this