Xerces 库和 Qt
我正在尝试设置 xerces,以便我可以在 Windows 版 Qt Creator 中使用它。
Qt 是否支持 windows/linux 二进制文件,或者我是否必须使用 mingw 作为目标来编译它?如何在 Windows 中编译这些库?
I'm trying to setup xerces so that I can use it in Qt Creator for Windows.
Does Qt support windows/linux binaries or do I have to compile it using mingw as a target? How one goes about compiling those libraries in Windows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可以,您不能在 Windows 下使用为 Linux 编译的库。您必须自己构建它或使用现有的 Windows 二进制发行版。具体如何工作取决于您要使用的第三方库。如果您必须自己构建它,基本选项是:在 Windows 下使用 MSVC 构建它,在 Windows 下使用 mingw 构建它,或者在 Linux 等环境下使用 mingw 交叉编译它。 MSVC 在 Windows 下往往不会那么麻烦,但 mingw 可能也能工作。
重要:当涉及到 C++ 库时,mingw 和 MSVC 与 ABI 不兼容。您不能在 mingw-Qt 项目中使用 MSVC 构建的 xerces,或者在 MSVC 项目中使用 mingw-Xerces。这只影响 C++ 库,而不影响纯 C 库。
No, you can't use libraries compiled for Linux under Windows. You'll have to either build it yourself or use existing Windows binary distribution. How that works in detail depends on the third-party library you want to use. The basic options are, in case you have to build it yourself: build it with MSVC under Windows, with mingw under Windows, or cross-compile it with mingw from e.g. Linux. MSVC tends to be less hassle under Windows, but mingw might just work as well.
Important: mingw and MSVC are ABI-incompatible when it comes to C++ libraries. You can't use e.g. a MSVC-built xerces in your mingw-Qt project, or a mingw-Xerces in an MSVC project. That only affects C++ libraries, not pure C ones.