关闭

QT5.6.0安装错误记录

标签: QT5-6-0
3193人阅读 评论(2) 收藏 举报
分类:

anzyelay@ubuntu:bin$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise

一 使用源码安装

下载源码后执行出错如下:

1. ./configure时出错 The test for linking against libxcb and support libraries failed!

错误提示里叫你查看:qtbase/src/plugins/platforms/xcb/README
里面提示安装相应库,查看版本后安装
sudo apt-get install libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysym s1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-ic ccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libx render-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-re nder-util0-dev libxcb-glx0-dev libxcb-xinerama0-dev
然后./configure正常

2. make 时出错,

make[3]: Entering directory `/home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/qt3d/src/logic'
make[3]: Nothing to be done for `first'.
make[3]: Leaving directory `/home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/qt3d/src/logic'
cd quick3d/quick3d/ && ( test -e Makefile || /home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/qtbase/bin/qmake /home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/qt3d/src/quick3d/quick3d/quick3d.pro -o Makefile ) && make -f Makefile 
/home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/features/qt_build_config.prf:45: Cannot write cache file /home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/.qmake.super: Permission denied
/home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/features/qt_build_config.prf:50: Cannot write cache file /home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/.qmake.super: Permission denied
Project ERROR: Unknown module(s) in QT: qml qml-private quick quick-private
make[2]: *** [sub-quick3d-core-make_first] Error 3
make[2]: Leaving directory `/home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/qt3d/src'
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/home/anzyelay/Desktop/arm/qt-everywhere-opensource-src-5.6.0/qt3d'
make: *** [module-qt3d-make_first] Error 2

一般你用make -jN出的错不一定是真正出错的地方,先换回make 后查看出错点,出错如下,加入sudo 依然出相同的错误,只是少了Permission denied那几句,问题依旧,,寻找 中。。。。。
错误太多了,结合后面的估计是不虚拟机中的原装UBUNTU不支持3D显示之类的,议政没解决先考虑用离线包安装了。

二 使用离线包安装

由于在线安装下载速度太慢了,不能忍,所以使用离线包吧。

1. 使用离线包安装后运行qtcreator出错

anzyelay@ubuntu:Qt5.6.0$ ./Tools/QtCreator/bin/qtcreator
This application failed to start because it could not find or load the Qt platform plugin “xcb”
in “”.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

Reinstalling the application may fix this problem.
Aborted (core dumped)

开始按百度的说法查找libqxcb.so库可以找到,修改LD_LIBRARY_PATH都没用,想想也是—离线包直接安装的配置这些应该都OK的,又不是源码编译安装的,况且qtcreator.sh这个本身就能配置参数运行,可问题依然。应该不是库文件找不到的问题。没办法我只能试着自己找了。,ldd查看其依赖库,发现“libEGL.so.1 => not found”

anzyelay@ubuntu:QtCreator$ ldd -d ./lib/Qt/plugins/platforms/libqxcb.so 
    linux-vdso.so.1 =>  (0x00007fff07fff000)
    libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007ff0e9d85000)
    libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007ff0e9ae7000)
    libQt5DBus.so.5 => /home/anzyelay/Qt5.6.0/Tools/QtCreator/./lib/Qt/plugins/platforms/../../lib/libQt5DBus.so.5 (0x00007ff0e9868000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007ff0e9666000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff0e945e000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007ff0e9168000)
    libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007ff0e8f5e000)
    libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007ff0e8d4d000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007ff0e8a17000)
    libEGL.so.1 => not found
    libQt5XcbQpa.so.5 => /home/anzyelay/Qt5.6.0/Tools/QtCreator/./lib/Qt/plugins/platforms/../../lib/libQt5XcbQpa.so.5 (0x00007ff0e86bf000)
    libQt5Gui.so.5 => /home/anzyelay/Qt5.6.0/Tools/QtCreator/./lib/Qt/plugins/platforms/../../lib/libQt5Gui.so.5 (0x00007ff0e7ec7000)
    libQt5Core.so.5 => /home/anzyelay/Qt5.6.0/Tools/QtCreator/./lib/Qt/plugins/platforms/../../lib/libQt5Core.so.5 (0x00007ff0e77b5000)
    libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007ff0e754f000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff0e7331000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff0e7031000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff0e6d35000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff0e6b1e000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff0e6760000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007ff0e6536000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff0e631e000)
    libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007ff0e60da000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff0e5e9c000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007ff0e5c7e000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff0e5a7a000)
    libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007ff0e5877000)
    libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007ff0e5667000)
    libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007ff0e545f000)
    libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007ff0e5244000)
    libEGL.so.1 => not found
    libicui18n.so.56 => /home/anzyelay/Qt5.6.0/Tools/QtCreator/./lib/Qt/plugins/platforms/../../lib/libicui18n.so.56 (0x00007ff0e4da9000)
    libicuuc.so.56 => /home/anzyelay/Qt5.6.0/Tools/QtCreator/./lib/Qt/plugins/platforms/../../lib/libicuuc.so.56 (0x00007ff0e49f1000)
    libicudata.so.56 => /home/anzyelay/Qt5.6.0/Tools/QtCreator/./lib/Qt/plugins/platforms/../../lib/libicudata.so.56 (0x00007ff0e300e000)
    /lib64/ld-linux-x86-64.so.2 (0x00007ff0ea1db000)
    libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007ff0e2de8000)
    libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007ff0e2be5000)
    libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007ff0e29df000)
    libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007ff0e27c7000)
    libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007ff0e25c2000)
    libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007ff0e23b7000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007ff0e21b3000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007ff0e1fad000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007ff0e1da7000)
anzyelay@ubuntu:QtCreator$ sudo find / -name libEGL.so*

anzyelay@ubuntu:QtCreator$

于时我偿试安装输入sudo apt-get install libegl后 tab出来如下:

anzyelay@ubuntu:QtCreator$ sudo apt-get install libegl1-mesa
libegl1-mesa                          libegl1-mesa-drivers-lts-saucy
libegl1-mesa-dbg                      libegl1-mesa-drivers-lts-saucy-dbg
libegl1-mesa-dev                      libegl1-mesa-drivers-lts-trusty
libegl1-mesa-dev-lts-quantal          libegl1-mesa-drivers-lts-trusty-dbg
libegl1-mesa-dev-lts-raring           libegl1-mesa-lts-quantal
libegl1-mesa-dev-lts-saucy            libegl1-mesa-lts-quantal-dbg
libegl1-mesa-dev-lts-trusty           libegl1-mesa-lts-raring
libegl1-mesa-drivers                  libegl1-mesa-lts-raring-dbg
libegl1-mesa-drivers-dbg              libegl1-mesa-lts-saucy
libegl1-mesa-drivers-lts-quantal      libegl1-mesa-lts-saucy-dbg
libegl1-mesa-drivers-lts-quantal-dbg  libegl1-mesa-lts-trusty
libegl1-mesa-drivers-lts-raring       libegl1-mesa-lts-trusty-dbg
libegl1-mesa-drivers-lts-raring-dbg   
anzyelay@ubuntu:QtCreator$ sudo apt-get install libegl1-mesa

试着安装libegl1-mesa-dev需要先安装libegl1-mesa-drivers ,于是我就先安装libegl1-mesa-drivers ,然后搜索居然找到了libEGL.so.1 ,就不用安装其它的libegl1-mesa-*了。

anzyelay@ubuntu:QtCreator$ sudo find / -name libEGL.so*
/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1.0
/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1

偿试运行

anzyelay@ubuntu:QtCreator$ ./bin/qtcreator
file:///home/anzyelay/Qt5.6.0/Tools/QtCreator/share/qtcreator/welcomescreen/welcomescreen.qml:31:1: module "QtQuick" is not installed 
     import QtQuick 2.1 
     ^
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
Could not link shader program:
 ""

OK,上面的错误解决了,这回能弹出qtcreator黑框,但依然出来了新的错误也算是有点进步了。但退出终端后重新打开终端又出同样的问题,不过有点区别了

anzyelay@ubuntu:bin$ ./qtcreator
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Reinstalling the application may fix this problem.
Aborted (core dumped)

r后来发现原因是我修改了qtcreator同目录的qt.conf配置文件,还原

  1 [Paths]                                                                     
  2 Prefix=../lib/Qt
  3 Libraries=lib
  4 Plugins=plugins
  5 Imports=imports
  6 Qml2Imports=qml

再次运行还是出如下问题:

anzyelay@ubuntu:bin$ ./qtcreator
QOpenGLShader: could not create shader
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShaderProgram::uniformLocation( imageTexture ): shader program is not linked

为了解决上面的问题google后先后安装了如下

1955 sudo apt-get install libglu1-mesa-dev
1956 sudo apt-get install libgl1-mesa-dev

然后重启机子时无法启动图形界面了,一直卡在有个ubuntu的标识界面(下面有几个点点的图)
后来使用如下方法安装了这两个东西后重启就OK了,而且启动qtcrearot也成功了。
sudo apt-get install ubuntu-desktop xorg

找了半天没有解决的问题,就这么糊里糊涂地解决了。。。虽然OK 了,但哪位大神可以提点下下这是为什么?

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:66265次
    • 积分:1471
    • 等级:
    • 排名:千里之外
    • 原创:85篇
    • 转载:5篇
    • 译文:0篇
    • 评论:13条
    文章分类
    最新评论