从源代码构建Qt 5.8-配置:未知的命令行选项'-c ++ 11' [英] Building Qt 5.8 from source - configure: Unknown command line option '-c++11'

查看:513
本文介绍了从源代码构建Qt 5.8-配置:未知的命令行选项'-c ++ 11'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 MinGW-64-bit 的说明,使用选项A:在MSYS2-shell&中建立Qt MinGW-w64 Win64 Shell.

I followed the instructions from MinGW-64-bit, using Option A: build Qt in MSYS2-shell & MinGW-w64 Win64 Shell.

gcc -v说:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-6.3.0/configure
--build=x86_64-w64-mingw32
--disable-isl-version-check
--disable-libstdcxx-debug
--disable-libstdcxx-pch
--disable-multilib
--disable-nls
--disable-rpath
--disable-symvers
--disable-werror
--disable-win32-registry
--enable-bootstrap
--enable-checking=release
--enable-fully-dynamic-string
--enable-graphite
--enable-languages=c,lto,c++,objc,obj-c++,fortran,ada
--enable-libatomic
--enable-libgomp
--enable-libstdcxx-time=yes
--enable-lto
--enable-shared
--enable-static
--enable-threads=posix
--host=x86_64-w64-mingw32
--libexecdir=/mingw64/lib
--prefix=/mingw64
--target=x86_64-w64-mingw32
--with-arch=x86-64
--with-bugurl=https://sourceforge.net/projects/msys2
--with-gmp=/mingw64
--with-gnu-as
--with-gnu-ld
--with-isl=/mingw64
--with-libiconv
--with-local-prefix=/mingw64/local
--with-mpc=/mingw64
--with-mpfr=/mingw64
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--with-pkgversion='Rev1, Built by MSYS2 project'
--with-system-zlib
--with-tune=generic
Thread model: posix
gcc version 6.3.0 (Rev1, Built by MSYS2 project)

我下载了源代码

git clone https://code.qt.io/qt/qt5.git
cd qt5
perl init-repository
git checkout 5.8

我知道还有其他选择:

  • git clone https://github.com/qt/qt5.git
  • wget http://download.qt.io/official_releases/qt/5.8/5.8.0/single/qt-everywhere-opensource-src-5.8.0.tar.gz

我在第二个选项(归档)中也观察到了同样的问题.

I've observed the same problem with the second option (archive).

安装所有必备组件后,我将构建OpenSSL和ICU-安装在

After installing all prerequisites I build OpenSSL and ICU - installed in

  • /usr/local/openssl
  • /usr/local/icu

但是从那里开始,说明并不十分清楚.据说使用Windows命令shell来设置一些环境变量.但是稍后我将使用MSYS2 64位外壳程序,因此这些无效.这是我所做的:

But from there on the instructions are not so clear. It's stated to use a windows command shell to set some environment variables. But later I'm using the MSYS2 64 Bit shell, so these have no effect. Here is what I did:

export INCLUDE=/usr/local/icu/include:/usr/local/openssl/include
export LIB=/usr/local/icu/lib:/usr/local/openssl/lib
export QMAKESPEC=
export QTDIR=
windows2unix() { local pathPcs=() split pathTmp IFS=\;; read -ra split <<< "$*"; for pathTmp in "${split[@],}"; do pathPcs+=( "/${pathTmp//+([:\\])//}" ); done; echo "${pathPcs[*]}"; }; systemrootP=$(windows2unix "$SYSTEMROOT"); export PATH="$PWD/qtbase/bin:$PWD/gnuwin32/bin:/c/msys64/mingw64/bin:/c/msys64/usr/bin:/c/msys64/usr/local/icu/lib"
export MAKE_COMMAND=
./configure -debug-and-release -opensource -confirm-license -platform win32-g++ -developer-build -c++11 -icu -opengl desktop -openssl -plugin-sql-odbc -nomake examples -nomake tests

configure脚本运行一段时间,但随后由于以下错误而停止:

The configure script runs some time, but then it stops with the following error:

...
Creating qmake................................................................................................Done.
Info: creating stash file C:\msys64\home\asp\qt5\.qmake.stash
Info: creating super cache file C:\msys64\home\asp\qt5\.qmake.super
ERROR: Unknown command line option '-c++11'.

也许我忘了在某个地方设置标志,但此刻我被困在这里.有人知道如何继续吗?

Maybe I forgot to set some flag somewhere, but for the moment I'm stuck right here. Does anybody know how to continue?

推荐答案

正确的编译器标志应为 -std = c ++ 11 ,而不是 -c ++ 11 >.

The correct compiler flag should be -std=c++11, not -c++11.

无论如何,GCC 6.x隐式使用C ++ 11,因此没有必要.这在作者的 answer 中的日志中也很明显.

Anyway, GCC 6.x uses C++11 implicitly, so it is not necessary. This is also apparent from the log in the author's answer.

这篇关于从源代码构建Qt 5.8-配置:未知的命令行选项'-c ++ 11'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆