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

2013年(1)

2008年(2)

2007年(14)

2006年(413)

分类:

2006-05-26 13:18:36

Setting up SDL in Dev C++

Last Updated 2/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 Mingw32 development library


Open gz archive and there should be a *.tar archive inside.
Open the *.tar and there should be a folder side of that.
Open the folder and it'll contain a bunch of subfolders.

Copy the contents of the lib subfolder to the Dev C++ lib folder.
The Dev C++ lib folder should be at C:\Dev-Cpp\lib.

Next copy the contents of the bin subfolder to the Dev C++ bin folder.
It should be at C:\Dev-Cpp\bin.

After that, open the include subfolder in the archive and extract the folder named "SDL" to the Dev C++ include folder, which should be at C:\Dev-Cpp\include.

Note: Some versions of SDL won't have a folder named "SDL" in the archive's include subfolder, but just a bunch of header files. To get around this simply create a folder named "SDL" in your Dev C++ include folder and copy all the header files from the archive to that folder you made.

Now take the SDL.dll from the archive (it should be inside the bin 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 Dev C++ and start a new empty project.

Go to the project options.

Under the General tab, set type to Win32 GUI.
This is to make sure a console window does not pop up.

Under the Parameters tab, paste:

-lmingw32 -lSDLmain -lSDL
in the linker.

Add source new source file to the project.

Paste the following code into the 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; }

Now Compile. Save the new source file if necessary.
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.
阅读(1751) | 评论(0) | 转发(0) |
0

上一篇:SDL in Code::Blocks

下一篇:SDL in Anjuta

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