编译GTK+与 Cygwin
我在 Linux 中创建了一个应用程序,使用 GTK2 作为 GUI。它使用一些特定于 Linux 的头文件(例如 arpa/inet.h),因此要在 Windows 下运行,我必须使用 Cygwin 对其进行编译。我下载了最新的安装程序并选择安装 GTK2 及其依赖项。我的程序编译得很好。但它需要 X 服务器运行!我有老式的、丑陋的图形,它不像所有 Windows 应用程序那样在不同的窗口中打开,而是在 X 服务器的窗口内打开。因此它无法便携。我找到了该指南,这正是我需要什么,但是当我为 GTK2 运行“make”时出现错误(_IID_IFilePersist 的未定义引用,尽管我安装了 uuid - 也用 gtk2.20 尝试过)。您能建议如何使用 cygwin 构建我的应用程序吗?或者我需要安装什么来解决“_IID_IFilePersist”错误?提前致谢!
I have created an application in linux with GTK2 as GUI. It uses some linux-specific headers (e.g. arpa/inet.h) so to run under Windows I have to compile it with Cygwin. I downloaded the latest installer and choose to install GTK2 and its dependencies. My program compiled fine. But it needs X server to be running! I has old-style, ugly graphics and it doesn't open in a different window, like all Windows' applications do, but inside X server's window. Because of this it can't be portable. I found that guide, which is exactly what I need, but I get an error when I run "make" for GTK2 (undefined reference for _IID_IFilePersist, although I have uuid installed - also tried it with gtk2.20). Can you suggest what to do to build my application with cygwin? Or what do I need to install for the "_IID_IFilePersist" error? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您不希望 X 服务器运行,那么您将必须移植代码中特定于 linux 的部分并使用 MinGW 而不是 Cygwin 进行编译。
If you don't want X server to be running, then you're going to have to port the linux-specific parts of your code and compile with MinGW rather than Cygwin.
有不依赖于 X 的 Windows 预构建包。 http://gtk -win.sourceforge.net/home/index.php/Downloads
There's prebuilt packages for windows that doesn't rely on X. http://gtk-win.sourceforge.net/home/index.php/Downloads