使用 C++ 编写了一个 SDL 游戏并想要部署它
我使用 C++ 在 SDL 中编写了这个非常简单的游戏,现在我想向一些使用 Windows 的朋友展示它。
我使用 Code::Blocks 在 Ubuntu 9.10 中编写了程序。
我想获取我的源代码并制作一个 Windows 安装程序,以便他们可以安装和播放它。
我该怎么做呢?
I wrote this really simple game in SDL using C++ and now I want to show it to some of my friends who are using Windows.
I wrote my program in Ubuntu 9.10 using Code::Blocks.
I want to take my source code and make a Windows installer so they can install and play it.
How can I go about doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不久前使用 NSIS 创建了一个安装程序。我从头开始,按照示例在 5-10 分钟内得到了一个合理的安装程序。最重要的是:它是免费的!
I created an installer using NSIS some time ago. I started out from scratch, and got a reasonable installer in 5-10 minutes, following the examples. Best of all: it's free!
恭喜完成一个项目。 :)
也就是说,现在您需要找到一个 Windows 编译器,例如 MinGW(gcc 的端口)或 Microsoft Visual Studio(2008 Express 是免费的,2010 Release Candidate 是免费的),以便您可以为 Windows 平台编译游戏。
只要您的代码是可移植的并且遵循标准(而且我知道 SDL 可以跨平台工作),您应该遇到的障碍就很少。如果您有任何问题,当然可以随时寻求帮助。您甚至可以将 CodeBlocks 与 MinGW 捆绑在一起(尽管它可能不是最新版本)并使用相同的项目结构。
一旦你开始工作,你需要一个安装系统来将你的所有东西打包在一起。我不是这方面的专家,但我喜欢 ClickTeam Install Creator ;它非常简单而且非常灵活。它需要花钱,但有一个免费软件版本,安装程序末尾带有“使用安装创建者制作”字样。
可能还有其他安装创建者,但我对他们的经验很少。您只需要确保您的最终用户拥有所需的二进制文件:打包您在游戏、所有数据等中使用的 SDL dll。
Congrats on completing a project. :)
That said, now you need to find a Windows compiler like MinGW (the port of gcc) or Microsoft Visual Studio (2008 Express is free, and 2010 Release Candidate is free) so you can compile your game for the Windows platform.
As long as your code is portable and sticks to the standard (and I know SDL works cross-platform), you should have minimal snags. If you have any problems of course feel free to ask for help. You can even just get CodeBlocks bundled with MinGW (though it may not be the latest version) and use the same project structure.
Once you've got that working, you need a install system to package all your stuff together. I'm no expert in this area, but I love the ClickTeam Install Creator; it's very easy yet very flexible. It costs money but there is a freeware version with a "made with Install Creator" at the end of your installer.
There may be other install creators, but I have little experience with them. You just need to make sure your end-users have the required binaries: package an SDL dll's you use with your game, all data, etc.