Jump to content
  • Advertisement
Sign in to follow this  
Just_starting

Trying to use SDL for the first time

This topic is 5397 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is the tutorial I am using: Create a new directory on the c: drive. Name it DEV. This is where you will be putting all of you additional libraries. Download the development binary HERE. Extract the lib, include, and doc folders to your DEV directory so it looks like C:\DEV -DEV\INCLUDE -DEV\LIB -DEV\DOC copy SDL.dll to your SYSTEM32 folder, or to the folder where your project is going to be saved. SDL.dll can be found in the lib folder. Open Visual C++ Add the include and lib directories to the related option fields. It's under Tools->Options->directories. Here is where I get stuck! The compiler I am using is Micosoft visual stuio.net 2003, under tools->options I am not sure what the related option feilds are and I have no option to add these dorectories anywhere? Thanks for any help in advance

Share this post


Link to post
Share on other sites
Advertisement
<cough><shameless plug/></cough>

[-edit-]
oh wait... nevermind. that sounds like what I told people to do, in my tutorial...

I'll update that section when I get my copy of vs.net...

Share this post


Link to post
Share on other sites
In VC++ .NET:

The place to set up your directories is under Tools->Options..., and the tree view should point to Projects/VC++ Directories.... This is where you put the directories for the include files and library files, ensure that the combo box entitled "Show Directories for:" is correctly saying "Include Files" or "Library Files" before adding the directories.

For each project, you create a WIN32 Project, and make sure you click the "Empty Project" under "Application Settings".

To ensure that you link to the SDL, right click your project in the solution explorer, and select properties. Select "All Configurations" In the top left combo box. Then go to C++/Code Generation, and change the "Runtime Library" to "Multi-Threaded DLL".

Then go to Linker/Input, and set the "Additional Dependencies" property to "sdl.lib sdlmain.lib". (If using SDL_mixer,SDL_image,SDL_ttf or SDL_net, you also put the appropriate lib files for these here).

Put sdl.dll into your project directory. (Also the dlls for any other SDL_* library you might be using)


Next, create main.cpp, and put in the following:


#include "sdl.h"
//any other header you might be using as well
int main(int argc,char* argv[])
{
SDL_Init(SDL_INIT_EVERYTHING);
//any other initializer function
//any other quit function
SDL_Quit();
return(0);
}


If it compiles and runs, you have been successful.


I /REALLY/ need to update those articles, and write more of them.

Share this post


Link to post
Share on other sites
Quote:
Original post by TANSTAAFL
I /REALLY/ need to update those articles, and write more of them.

Yes, you do [grin]

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!