移植 C++应用程序从 Windows 到 GNU/Linux。

发布于 2024-09-01 22:02:15 字数 412 浏览 2 评论 0原文

我正在尝试将电脑游戏从 Windows 移植到 GNU/Linux。它使用Ogre3D、CEGUI、ogreogg 和ogrenewt。据我所知,所有依赖项都适用于 GNU/Linux,并且游戏本身没有特定于 ooze 的代码。

以下是提问部分: 有没有简单的方法将 Visual Studio 2008 项目移植到 GNU/Linux 工具链?

如何管理依赖关系?在 Visual Studio 中,我只需将它们添加到属性表或默认目录中。我假设在 GNU/Linux 上 autoconf 并 make 处理这个问题,但是以哪种方式呢?我是否必须手动添加每个 .cpp.hpp 还是有某种方法可以自动化操作?如何解决不同系统上不同位置的依赖问题?我想在 GNU/Linux 下使用 Eclipse 作为我的 IDE。

I'm trying to port a computer game from windows to GNU/Linux. It uses Ogre3D,CEGUI, ogreogg and ogrenewt. As far as I know all dependencies work on GNU/Linux and in the game itself there is no ooze-specific code.

Here's the questions part:
Is there any easy way to port visual studio 2008 project to GNU/Linux tool-chain?

How do I manage dependencies? In Visual Studio, I'd just add them in property sheets or default directories. I assume on GNU/Linux autoconf and make take care of that, but in which way? Do I have to add each .cpp and .hppmanually or is there some way to automate things? How do I solve the problem of dependencies on different locations on different systems? I'd like to use Eclipse as my IDE under GNU/Linux.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

七度光 2024-09-08 22:02:15

正如@pmr 所指出的,您确实在寻找构建系统。虽然传统上一直使用 GNU Autotools(Automake、Autoconf 等),但这些工具存在很多问题,并且学习曲线极其陡峭。相反,我强烈建议您使用 CMake。 CMake 在某种程度上是一种元构建系统,因为 CMake 使用 CMake 项目描述为各种构建系统生成项目;默认情况下,CMake 从其项目描述生成 Makefile 项目,但它也可以为 Visual Studio、Xcode、KDevelop 等生成项目。您可以找到 C++ 应用程序项目模板C++ 库项目模板 作为如何使用 CMake 构建系统的示例。有关 CMake 的教程和其他介绍性材料可以在 CMake Wiki 上找到,而 CMake 参考手册 提供了 CMake 所使用的所有各种命令的详细说明支持(您可能会发现 ADD_EXECUTABLE、ADD_LIBRARY、TARGET_LINK_LIBRARIES、INCLUDE_DIRECTORIES 和 LINK_DIRECTORIES 是可用命令中最有用的)。另外,虽然我强烈建议您使用 CMake 而不是 Make,但您可能会发现我的 Makefile 教程 在您决定使用 Make 时很有用。

As @pmr has noted, you are really looking for a build system. While the GNU Autotools (Automake, Autoconf, etc.) have traditionally been used, there are a lot of problems with these tools, and they have an incredibly steep learning curve. I would strongly suggest, instead, that you use CMake. CMake is somewhat of a meta build system in that CMake generates projects for a variety of build systems using the CMake project description; CMake, by default, generates a Makefile project from its project description, but it can also generate projects for Visual Studio, Xcode, KDevelop, and others. You may find the C++ Application Project Template and the C++ Library Project Template useful as examples of how to use the CMake build system. Tutorials and other introductory material about CMake may be found on the CMake Wiki, while the CMake Reference Manual gives detailed instructions for all the various commands that CMake supports (you will probably find ADD_EXECUTABLE, ADD_LIBRARY, TARGET_LINK_LIBRARIES, INCLUDE_DIRECTORIES, and LINK_DIRECTORIES to be the most useful of the commands that are available). Also, while I would strongly advise you to use CMake instead of Make, you may find my Makefile tutorial useful in the event you decide to use Make.

情独悲 2024-09-08 22:02:15

您本质上要问的是:什么是 GNU/Linux 的良好构建系统。这个问题没有明确的答案。 Make + autoconf 是标准的处理方式,但您可能会更喜欢 cmake,它具有跨平台的优点。

What you are essentially asking is: What is a good build system for GNU/Linux. There is no definitive answer to this problem. Make + autoconf are the standard way of doing things but you could be happier with cmake which has the benefit of being cross-plattform.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文