我可以编译Qt应用程序而忽略Qt的打包库吗?(Can I compile a Qt application while ignoring Qt's packaged libraries?)

编程入门 行业动态 更新时间:2024-10-15 14:15:07
我可以编译Qt应用程序而忽略Qt的打包库吗?(Can I compile a Qt application while ignoring Qt's packaged libraries?)

我试图在Antergos Arch Linux中编译Qt应用程序,并且该应用程序使用与icu相关的库。 当我遇到以下链接错误时,我有点困惑:

/usr/bin/ld: warning: libicuuc.so.60, needed by /usr/lib/libxml2.so.2, may conflict with libicuuc.so.56 /usr/bin/ld: warning: libicudata.so.60, needed by /usr/lib/libicuuc.so.60, may conflict with libicudata.so.56

接下来是几个未定义的库引用函数。 我仔细检查了我在系统上的所有libicu*版本,只能找到版本60; 直到我查看Qt安装目录下的Qt/5.10.0/gcc_64/lib ,我才意识到Qt提供了56版的库文件。

我对连接器相关问题并不热衷。 是否有可能让编译器忽略Qt提供的库,并且仅仅与我的系统上已有的版本60库相链接? 如果不是,我的解决方法有哪些选择?

I am attempting to compile a Qt application in Antergos Arch Linux, and the application makes use of icu-related libraries. I was a little confused when I got the following linker errors:

/usr/bin/ld: warning: libicuuc.so.60, needed by /usr/lib/libxml2.so.2, may conflict with libicuuc.so.56 /usr/bin/ld: warning: libicudata.so.60, needed by /usr/lib/libicuuc.so.60, may conflict with libicudata.so.56

These were followed by several undefined references to functions from the libraries. I double-checked all the versions of libicu* that I had on my system and could only find version 60; it wasn't until I looked in my Qt install directory, under Qt/5.10.0/gcc_64/lib, that I realised Qt was providing the version 56 library files.

I'm not all that hot on linker-related problems. Is it possible to have the compiler ignore the libraries provided with Qt and just link against the version 60 libs that I already have on my system? If not, what are my options for workarounds?

最满意答案

是和不是。

理论上Qt可以简单地使用v60而不是v56 icu库,前提是这两个版本是二进制兼容的。

但是,Qt库特别需要icu库的版本56。 你也试图使用libxml,它需要icu库的版本60。 这意味着你同时需要版本56和版本60,这是不可能的,因为你最终会遇到冲突的符号。

你问题的根源很可能是你使用Qt公司提供的Qt包。 这些软件包可以与大多数Linux发行版一起使用,但它们不能100%兼容。

解决方案是使用使用相同版本的icu库的Qt和libxml版本。 最简单的解决方案是使用Linux发行版提供的Qt库。 另一个解决方案是从源代码构建Qt。

Yes and no.

In theory Qt could simply use the v60 instead of the v56 icu library, provided that the 2 versions are binary compatible.

However, Qt libraries specifically require the version 56 of the icu libraries. Also you are trying to use libxml which requires the version 60 of the icu libraries. That means that you need both version 56 and 60 at the same time, which is not possible because you end up with conflicting symbols.

The origin of you issue is likely that you use the Qt packages provided by the Qt Company. Such packages are built to work with most Linux distributions, but they cannot be 100% compatible.

The solution is to use builds of Qt and libxml that use the same version of the icu libraries. The easiest solution is to use the Qt libraries provided by your Linux distro. Another solution is to build Qt from source.

更多推荐

本文发布于:2023-08-01 22:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1365871.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   而忽略   compile   Qt   packaged

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!