Newb needing help (tutorial 1)

Started by
3 comments, last by Oglethorpe 19 years, 4 months ago
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.
Advertisement
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.
what does pragma mean... =/


and, do you know how to linkit from the settings?

[Edited by - Oglethorpe on November 30, 2004 7:32:47 PM]
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.
Thanhda TieDigital Shock, Technical Director & Business Relations15-75 Bayly Street West, Suite #173Ajax, Ontario, L1S 7K7Tel: 416.875.1634http://www.digitalshock.net
thanks man i couldnt figure out that linker part in the options.

so much eaiser than typing in the pragma =]

This topic is closed to new replies.

Advertisement