Qt570_CentOS64x64_02
1、Qt570的简单测试项目,在做"重新构建"的操作的时候,出现1个问题,Qt底下的"编译输出"窗口中的信息为:
cc1plus: error: unrecognized command line option "-std=gnu++11"
make: *** [main.o] Error 1
17:01:27: 进程"/usr/bin/make"退出,退出代码 2 。
Error while building/deploying project qt570_test_01 (kit: Desktop Qt 5.7.0 GCC 64bit)
When executing step "Make"
17:01:27: Elapsed time: 00:00.
1.1、这个报错是∵ gcc-c++ 版本太低,需要升级到 >=4.7:http://www.51bbo.com/archives/2228
ZC: 这里,我只升级到了 4.7,没有升级到4.8
wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo
yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++
安装文件放置位置在:/opt/centos/devtoolset-1.1
具体程序文件位置在:/opt/centos/devtoolset-1.1/root/usr/bin/*
使用最新的gcc环境,所以要替换本地的,使用软连接来完成(也可以设置环境变量,看自己喜好)
mv /usr/bin/gcc /usr/bin/gcc-4.4.7
mv /usr/bin/g++ /usr/bin/g++-4.4.7
mv /usr/bin/c++ /usr/bin/c++-4.4.7
ln -s /opt/centos/devtoolset-1.1/root/usr/bin/gcc /usr/bin/gcc
ln -s /opt/centos/devtoolset-1.1/root/usr/bin/c++ /usr/bin/c++
ln -s /opt/centos/devtoolset-1.1/root/usr/bin/g++ /usr/bin/g++
gcc --version
2、再次编译,没错了。Release程序在IDE中执行的时候,出现如下错误:
ZC: 貌似是在 QWebEngineView*->load(???)的时候出现该问题
Starting /home/qt532_projects/build-qt570_test_01-Desktop_Qt_5_7_0_GCC_64bit-Release/qt570_test_01... [0913/090214:ERROR:browser_main_loop.cc(217)] Running without the SUID sandbox! See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the sandbox on. [0913/090214:FATAL:namespace_sandbox.cc(141)] Check failed: clone_flags & CLONE_NEWUSER. #0 0x7f9b42bffaee <unknown> #1 0x7f9b42c1440e <unknown> #2 0x7f9b428a4df5 <unknown> #3 0x7f9b428a528c <unknown> #4 0x7f9b41fd1108 <unknown> #5 0x7f9b42043b46 <unknown> #6 0x7f9b41e85344 <unknown> #7 0x7f9b412d0011 <unknown> #8 0x7f9b412d0cad <unknown> #9 0x7f9b412c428e <unknown> #10 0x7f9b412c7785 QtWebEngineCore::WebContentsAdapter::WebContentsAdapter() #11 0x7f9b460429f5 <unknown> #12 0x7f9b46042f94 QWebEnginePage::QWebEnginePage() #13 0x7f9b4604da2b QWebEngineView::page() #14 0x7f9b4604db79 QWebEngineView::load() #15 0x000000403240 MainWindow::MainWindow() #16 0x000000402dac main #17 0x0037bce1ecdd <unknown> #18 0x000000402e29 <unknown> 程序异常结束。 /home/qt532_projects/build-qt570_test_01-Desktop_Qt_5_7_0_GCC_64bit-Release/qt570_test_01 crashed.
2.1、
http://askubuntu.com/questions/329320/chromium-running-without-the-suid-sandbox-error
http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?prefix=Linux_x64/382014/ (ZC: 需要f/q)
2.2、
sudo mv chrome_sandbox chrome-sandbox
sudo chown root chrome-sandbox
sudo chmod 4755 chrome-sandbox
./chrome-wrapper
[root@localhost chrome-linux]# ./chrome-wrapper
/home/chrome-linux/chrome: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/chrome-linux/chrome)
/home/chrome-linux/chrome: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by /home/chrome-linux/chrome)
/home/chrome-linux/chrome: /usr/lib64/libnss3.so: version `NSS_3.14.3' not found (required by /home/chrome-linux/chrome)
[root@localhost chrome-linux]# ./chrome-wrapper
/home/chrome-linux/chrome: /usr/lib64/libnss3.so: version `NSS_3.14.3' not found (required by /home/chrome-linux/chrome)
[root@localhost chrome-linux]# yum list nss*
../glibc-2.15/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
安装升级 glibc,参考:http://blog.csdn.net/hnhuangyiyang/article/details/50392997
2.3、
./chrome-wrapper(Linux_x64%2F250015%2Fchrome-linux.zip) 又说 找不到变量g_variant_builder_init,http://www.linuxforums.org/forum/red-hat-fedora-linux/205952-issue-google-chrome-rhel6.html 中说“Do you have glib 2.2.4 or greater installed? It's a part of the gnome library.” 也有人说 不再支持...
ZC: 使用 yum update glib2,升级了一下 glib2 和 glib2-devel,g_variant_builder_init的报错没有了。又说 "undefined symbol: gtk_offscreen_window_new"
ZC: 使用 "yum update gtk2",升级 gtk2相关信息,但是需要下载 总共219M的东西...
ZC: 运行"./chrome-wapper" 提示信息:“不能以根用户身份运行 chromium”,命令改成这样:“./chrome-wapper --user-data-dir”就行了
2.4、按照"2.1"&"2.2"中的说法弄了之后 chrome是打开了,但是 Qt执行时的错误依旧...
3、不知道怎么弄了... 以后再说,或者 等5.7.1吧...
4、
5、