发布于 2017-12-17 13:30:20
结果发现,它是Qt中的一个bug,没有通过在工具包中提供它的路径来切换到使用给定的编译器。但是,我从终端执行了以下步骤:
// Update & Build Essentials & add ppa of the gcc & update again
$ sudo apt-get update
$ sudo apt-get install build-essential software-properties-common -y
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y // ppa of gcc 6.3
$ sudo apt-get update
$ sudo apt-get install gcc-snapshot -y
$ sudo apt-get update
// Install the gcc and Add the gcc as an alternative
$ sudo apt-get install gcc-6 g++-6 -y
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
// You can switch the gcc verions via
$ sudo update-alternatives --config gcc代替了我现有的GCC。一旦我恢复了Qt创建者的默认工具包,并将默认的GCC设置为6.3而不是4.8,我就能够轻松地运行C++14特性,前提是CONFIG += c++14在.pro中。
https://stackoverflow.com/questions/45541623
复制相似问题