Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1426979
  • 博文数量: 430
  • 博客积分: 9995
  • 博客等级: 中将
  • 技术积分: 4388
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-24 18:04
文章存档

2013年(1)

2008年(2)

2007年(14)

2006年(413)

分类: LINUX

2006-05-26 13:16:45

Setting up SDL in Visual Studio.NET 2003

Last Updated 3/20/06

First thing you need to do is download SDL headers and binaries.
You will find them on the SDL website, specifically on .

Scroll Down to the Development Libraries section and download the Windows development library

Open the zip and there should be a folder side of it.
Open the folder and it'll contain a bunch of subfolders.

Copy SDL.lib and SDLmain.lib from the lib subfolder in the archive to the Visual C++ lib folder.
The Visual C++ lib folder should be at C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib.

Next go to the Visual C++ include folder and create a folder called "SDL".
The Visual C++ include folder should be at C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\Include.

Then open the include subfolder in the archive and extract its contents to the folder you just made, which should be at C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\Include\SDL.

Now take the SDL.dll from the archive (it should be inside the lib subfolder), and extract it to C:\WINDOWS\SYSTEM32.
This is so whenever you make an SDL app, the program will be able to find SDL.dll even if SDL.dll is not in the same directory.

Now start up Visual Studio and start a new Win32 project:

and click ok.

Make sure it's an empty project by going to the application settings:

and checking "Empty Project" so nothing is automatically generated.

Then add a new source file to the project:

Then paste the following code into your new source file:
#include "SDL/SDL.h" int main( int argc, char* args[] ) { //Start SDL SDL_Init( SDL_INIT_EVERYTHING ); //Quit SDL SDL_Quit(); return 0; }
and save the source file.

Next go to project settings.

In the C/C++ folder under Code Generation, set "Runtime Library" to multi-threaded dll.

In the Linker folder under Input, paste:

SDL.lib SDLmain.lib
in the additional dependencies field.

Now Build.
If there's no errors, you're finished.

Also, In the archive you just downloaded there's a subfolder called "docs". It contains the SDL documentation.

I highly recommend that you extract them somewhere and keep it for reference.
阅读(1406) | 评论(1) | 转发(0) |
0

上一篇:SDL in Visual C++ 6.0

下一篇:SDL in Eclipse

给主人留下些什么吧!~~