< Browse > Home / All, Settings / Blog article: Setting Visual Studio 2008 for SDL

| Mobile | RSS

Setting Visual Studio 2008 for SDL

December 30th, 2008 | 10 Comments | Posted in All, Settings

You must have Microsoft Visual C++ 2008 Express Edition and need SDL header and library before starting to the next step. You can download SDL header and library here.

1. What you should do is just run VS8.bat. This application will run the cmd command to copy the files that you download to a folder in your Visual Studio library.

When we see the command in the application, which we see are:

copy lib\*.lib "C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\"*.lib
mkdir "C:\Program Files\Microsoft Visual Studio 9.0\VC\include\SDL"
copy SDL "C:\Program Files\Microsoft Visual Studio 9.0\VC\include\SDL"
copy system32 C:\WINDOWS\system32
pause

So if you fail in the running VS8.bat (some or all of the files are not copied), you can do manual copy-paste. This problem often occurs if you use Windows Vista. This is because the UAC (User Account Control). You can read about UAC here.

2. Run Microsoft Visual C++ 2008 Express Edition.

3. Select File - New Project. In the Project types select Visual C + + - Win32. In the Templates section, select Win32 Console Application. Enter the name and location of the project want to make, and then click OK.

4. In the dialog box that appears, select the Application Settings, then Empty contents check box project. Then click Finish.

5. Right-click on the files in the folder Source Solution Explorer, select Add - New Item to create a new file.

6. Select Visual C + + - Code on the Categories, and then select “C + + File (. CPP)” at the Templates. Enter the name of the file you want and click the Add button.

7. In the Menu bar select Project - Properties the Add button.

8. Select the Configuration Properties - C + + - General. Then change the contents Detect 64-bit Portability Issues to be ‘No‘.

9. Select the Configuration Properties - C + + - Code Generation. Then change the contents to be Runtime Library Multi-threaded DLL (/ MD).

10. Select the Configuration Properties - Linker - Input. Then fill with Additional dependencies “SDL.lib SDLmain.lib SDL_image.lib SDL_ttf.lib“.

11. Select the Configuration Properties - Linker - System. Then change the property into Windows Subsystem (/ subsystem: WINDOWS). Then click the OK button.

12. Finish.

Leave a Reply 7191 views, 4 so far today |

You must read this :

Follow Discussion

10 Responses to “Setting Visual Studio 2008 for SDL”

  1. Timur I. Alhimenkov Says:

    Wow! Thank you very much!
    I always wanted to write in my blog something like that. Can I take part of your post to my blog?
    Of course, I will add backlink?

    Regards, Timur I.

  2. admin Says:

    yeah, of course you can…

  3. Bak Yeono Says:

    thank you very much!
    it was very helpful.
    but i have a question.
    do i need to do it all again every time i make a new project?
    is there any way to make a templete project or something like that?

  4. admin Says:

    you need to do all again every make a new project.

    if you want to make template, just save that project (after settings) with name as do you want. If you want to using it, then you can open that project, save your new project with different filename.
    Don’t replace your template !!

    with this way, you do not need to do it every making a new project.

  5. Bak Yeono Says:

    thanks a lot.
    eventually, i’ve found that to do it all again was not so stressful.
    but i found another problem with using micro$oft visual c 2008: the others can’t use my program.
    what the hell did m$ do? i can’t get the point.
    with your very helpful guide i was able to make a sdl program with visual c 2008.
    but finally, i came back to my lovely dev-cpp.
    sorry to ignore you for a while, my dear dev!

    whoever wish to compile a sdl project with visual c 2008, you can follow this guide.
    but don’t forget to distribute m$ .net framework with your program!

  6. admin Says:

    the others can’t use your program because they don’t have application extension in their computer. So, they need to do step one before they using your program

    and then, I also love dev-cpp : )

  7. Stanley Says:

    wah indra keren ^_^

  8. Greg Says:

    Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

  9. shadi Says:

    hi
    i do these setting on my program but i dont understand the first !!!! and
    i see this when i compile it :

    Error    1    fatal error C1083: Cannot open include file: ‘SDL.h’: No such file or directory    c:\users\shadi\documents\visual studio 2008\projects\graphic\graphic\f.cpp    1    graphic

    why it doesnt have the file ?

  10. shadi Says:

    i found the solution … please clear my msg !!!:D:D and thank u very much (for your usefull post:D:D)

Leave a Reply

sawajiri-erika-00071236sawajiri-erika-00071238sawajiri-erika-00071226sawajiri-erika-00071248sawajiri-erika-00071225sawajiri-erika-000712351969454_1156852473