当我有一个需要 libX11.so、libGL.so 和 libGLU.so 的应用程序时,如何使用 cygwin 交叉编译到 Linux?

发布于 2024-08-20 13:30:41 字数 219 浏览 5 评论 0原文

我是否必须使用 cygwin 提供的 crosstool 来使用各自的源代码制作 libX11.so、libGL.so 和 libGLU.so 库?或者你知道我在哪里可以找到已经为 crosstool 编译的它们(我是这个交叉编译的新手)?

只是为了澄清:我在一台 Windows 7 机器上尝试使用 cygwin 的交叉编译来让我的应用程序也为 Linux 系统进行编译。该应用程序使用 OpenGL。谢谢

Will I have to use the crosstool that cygwin provides to make the libX11.so, libGL.so, and libGLU.so libraries using their respective source code? Or do you know where I can find them compiled already for crosstool (I'm new to this cross compilation)?

Just for clarification: I'm on a windows 7 machine trying to get my application also to compile for linux systems by using cygwin's cross compilation. The application uses OpenGL. Thanks

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

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

发布评论

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

评论(3

依 靠 2024-08-27 13:30:41

要针对 Linux 进行交叉编译,您应该在 Linux 机器上安装所需的开发库和头文件[1],然后复制 /usr/lib 和 /usr/include 您的 cygwin 环境(例如 /crosscompiler/linux/...)。当您在 cygwin 中构建交叉编译器时,请告诉它那些本机 Linux 标头和库的位置,以便在编译应用程序时使用它们。

[1] 如果您希望在各种 Linux 机器上运行,请确保选择较旧的 Linux 发行版(例如 Red Hat 9),以确保您的应用程序不依赖于非常新的 glibc 等。

To cross-compile for Linux you should install the needed development libs and headers on a linux box[1] and then copy /usr/lib and /usr/include your cygwin environment (e.g. /crosscompiler/linux/...). When you build the cross compiler in cygwin, tell it where those native linux headers and libs are so they'll be used when you compile your app.

[1] If you're looking to run on a wide variety of linux boxes make sure you pick an older linux distro (e.g. Red Hat 9) to ensure your app doesn't have dependencies on very new glibc, etc..

孤星 2024-08-27 13:30:41

为什么要使用 Cygwin?

OpenGL Wiki 上有关于如何使用 MinGW 在 Windows 上使用 OpenGL 的说明。

MinGW 使用与 Linux 上可用的相同的 GNU 工具(GCC、GDB、GMAKE 等),但生成 Windows 本机可执行文件。因此,您在两个平台上编译源代码应该不会遇到问题。

Why do you want to use Cygwin?

There is instructions on the OpenGL Wiki about how to use OpenGL on Windows using MinGW.

MinGW use the same GNU tools that are available on Linux (GCC, GDB, GMAKE, etc.) but produce Windows native executables. So, you shouldn't have trouble compiling your source code on both platforms.

往日 2024-08-27 13:30:41

我刚刚在本地 Linux 机器上进行了构建。

I just ended up building on a native Linux machine.

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