redhat 安装Qt中遇到的问题

来源:互联网 发布:mac怎么下载魔兽世界 编辑:程序博客网 时间:2024/04/24 13:34
1  下载文件
2  解压 tar -zxvf 文件
3  ./configure -prefix /opt/qt5.7  //选择目录
4  选择 ‘o’ open source
5  yes

  过程中 出现的问题1:.cc1plus: 错误:无法识别的命令行选项“-std=c++11”
    原因:gcc版本过低 安装4.8.2
    1、解压并进入解压目录:
    2、./contrib/download_prerequisites //其实这个脚本就是下载那对应的3个文件 可以自己手动下载。人家写了就用呗 方便。
    3、 mkdir gcc-build-4.8.2
    4  cd gcc-build-4.8.2
    5、../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
    6、make
    7、make install
  完成之后基于安装qt 出现如下问题:
    The test for linking against libxcb and support libraries failed!
 You might need to install dependency packages, or pass -qt-xcb.
 See src/plugins/platforms/xcb/README.

    心累!!!还好电脑有网!!yum install xcb* 在重新弄 好了!!下面是已经安装的软件:
已安装:
  xcb-proto.noarch 0:1.11-1.el6                                                 
  xcb-util-image.x86_64 0:0.4.0-3.el6                                           
  xcb-util-image-devel.x86_64 0:0.4.0-3.el6                                     
  xcb-util-keysyms.x86_64 0:0.4.0-1.el6                                         
  xcb-util-keysyms-devel.x86_64 0:0.4.0-1.el6                                   
  xcb-util-renderutil.x86_64 0:0.3.9-3.el6                                      
  xcb-util-renderutil-devel.x86_64 0:0.3.9-3.el6                                
  xcb-util-wm.x86_64 0:0.4.1-5.el6                                              
  xcb-util-wm-devel.x86_64 0:0.4.1-5.el6   
    
    
    没网的孩子就一个个慢慢装吧。。

    然后 make 经过漫长的等待大概1个多小时,以为好了 没想到又出现问题:

    /opt/qt/qt-everywhere-opensource-src-5.7.0/qtscxml/bin/qscxmlc: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /opt/qt/qt-everywhere-   opensource-src-5.7.0/qtscxml/bin/qscxmlc)
make[4]: *** [statemachine.h] 错误 1
make[4]: Leaving directory `/opt/qt/qt-everywhere-opensource-src-5.7.0/qtscxml/examples/scxml/trafficlight-widgets-static'
make[3]: *** [sub-trafficlight-widgets-static-make_first] 错误 2
make[3]: Leaving directory `/opt/qt/qt-everywhere-opensource-src-5.7.0/qtscxml/examples/scxml'
make[2]: *** [sub-scxml-make_first] 错误 2
make[2]: Leaving directory `/opt/qt/qt-everywhere-opensource-src-5.7.0/qtscxml/examples'
make[1]: *** [sub-examples-make_first] 错误 2
make[1]: Leaving directory `/opt/qt/qt-everywhere-opensource-src-5.7.0/qtscxml'
make: *** [module-qtscxml-make_first] 错误 2

    还好这个错误之前遇到过。查看一下系统支持的glibc

[root@localhost lib]# strings /usr/lib64/libstdc++.so.6 |grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

刚安装过gcc 不应该出现这个问题呀!

默认安装路径在/usr/local/lib64   cd进入


[root@localhost local]# strings ./lib64/libstdc++.so.6 |grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

到安装gcc目录 是有的。

[root@localhost local]# cp lib64/libstdc++.so.6.0.18 /usr/lib64/
[root@localhost local]# cd /usr/lib64/
[root@localhost lib64]# rm libstdc++.so.6
rm:是否删除符号链接 "libstdc++.so.6"?y
[root@localhost lib64]# ln -s libstdc++.so.6.0.18 libstdc++.so.6
[root@localhost lib64]# strings /usr/lib64/libstdc++.so.6 |grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

继续make  出现qevdevgamepadbackend.cpp:265:18: 错误bulabula  反正我没找到办法。进入那个函数把那四句给注释了,有解决方法的说一下。。。 继续make

经过漫长的等待,成功。

0 0