免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 885 | 回复: 0
打印 上一主题 下一主题

SDL in Code::Blocks [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-26 13:18 |只看该作者 |倒序浏览
Setting up SDL in Code::Blocks
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
this page
.
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 Code::Blocks lib folder. The Code::Blocks lib folder should be at C:\Program Files\CodeBlocks\lib.
Next copy the contents of the bin subfolder to the Code::Blocks bin folder. It should be at C:\Program Files\CodeBlocks\bin.
After that, open the include subfolder in the archive and extract the folder named "SDL" to the Code::Blocks include folder, which should be at C:\Program Files\CodeBlocks\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 Code::Blocks 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 Code::Blocks and create a new SDL project.

Then save the project where ever you want.
Next, go to the project -> properties.


Under the Targets tab, set type to "GUI application". Also make sure to uncheck "Pause when execution ends".
This is to make sure a console window does not pop up.


Code::Blocks automatically generated a sample program for you. This program includes a source and image file which are located in the same folder where you saved the project.

All you have to do is hit F9 to compile and run your program. If there are no errors, you're done. Otherwise go back and make sure everything is done.
Newer versions of code::blocks automatically link SDL in your project. Older versions require you to
do it yourself
.
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.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/19671/showart_118478.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP