Setting Visual Studio 2008 for SDL
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.










January 28th, 2009 at 8:59 am
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.
January 31st, 2009 at 3:43 pm
yeah, of course you can…
February 5th, 2009 at 7:24 pm
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?
February 6th, 2009 at 6:58 pm
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.
February 12th, 2009 at 2:56 am
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!
February 12th, 2009 at 12:05 pm
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 : )
October 21st, 2009 at 12:24 pm
wah indra keren ^_^
January 21st, 2010 at 7:25 pm
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.
March 18th, 2010 at 12:51 pm
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 ?
March 18th, 2010 at 12:57 pm
i found the solution … please clear my msg !!!:D:D and thank u very much (for your usefull post:D:D)