使用Qt4 包在Centos上编译时,出现libQtGui.so 找到未定义的png等。
首先进行网上搜索,没有发现任何思路。
执行ldd时,发现少了很多依赖库,如下:
ldd libQtGui.so
linux-vdso.so.1 => (0x00007fffbaf81000)
libQtCore.so.4 => /usr/local/Trolltech/qt-x11-4.8.5/lib/libQtCore.so.4 (0x00007fcd8bfff000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcd8bdda000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007fcd8baa3000)
libpng16.so.16 => not found
libz.so.1 => /lib64/libz.so.1 (0x00007fcd8b88c000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007fcd8b5e6000)
libXrender.so.1 => not found
libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007fcd8b3a8000)
libXext.so.6 => not found
libX11.so.6 => /lib64/libX11.so.6 (0x00007fcd8b06a000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fcd8acee000)
libm.so.6 => /lib64/libm.so.6 (0x00007fcd8a9ec000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fcd8a7d6000)
libc.so.6 => /lib64/libc.so.6 (0x00007fcd8a408000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fcd8a204000)
librt.so.1 => /lib64/librt.so.1 (0x00007fcd89ffc000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcd8d1e7000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fcd89dd1000)
libxcb.so.1 => /lib64/libxcb.so.1 (0x00007fcd89ba9000)
libXau.so.6 => /lib64/libXau.so.6 (0x00007fcd899a4000)
所以将这些依赖库安装上就OK了。
具体如何找库,按照下面的步骤即可:
libXrender
[root@VM_137_149_centos libpng-1.6.36]# yum whatprovides libXrender
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
libXrender-0.9.10-1.el7.i686 : X.Org X11 libXrender runtime library
Repo : os
libXrender-0.9.10-1.el7.x86_64 : X.Org X11 libXrender runtime library
Repo : os
[root@VM_137_149_centos libpng-1.6.36]# yum install libXrender-0.9.10-1.el7.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package libXrender.x86_64 0:0.9.10-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================
Package Arch Version Repository Size
================================================================================================================
Installing:
libXrender x86_64 0.9.10-1.el7 os 26 k
Transaction Summary
================================================================================================================
Install 1 Package
Total download size: 26 k
Installed size: 46 k
Is this ok [y/d/N]: y
Downloading packages:
libXrender-0.9.10-1.el7.x86_64.rpm | 26 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libXrender-0.9.10-1.el7.x86_64 1/1
Verifying : libXrender-0.9.10-1.el7.x86_64 1/1
Installed:
libXrender.x86_64 0:0.9.10-1.el7
Complete!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)