Qt Creator使用位于另一个地方的另一个GCC版本 [英] Qt Creator use another GCC Version located in another Place

查看:917
本文介绍了Qt Creator使用位于另一个地方的另一个GCC版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在/ opt文件夹中安装了gcc 4.8.0。
我把PATH放在里面,所以当我做一个gcc / g ++ -v时,它返回给我4.8.0版本。
但是当我去QT Creator并用c ++ 11代码编译我的程序(在4.3>中实现)时,它不能编译。
所以我把一个-v选项放在QMAKE_CXXFLAGS标志中。
所以我得到:

 使用内置规格。 
目标:i686-apple-darwin11
配置为:/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix = /Developer/usr/llvm-gcc-4.2 --mandir = / share / man --enable-languages = c,objc,c ++,obj-c ++ --program-prefix = llvm- --program-transform-name = / ^ [cg] [^ .-] * $ / s / $ / - 4.2 / --with-slibdir = / usr / lib --build = i686-apple-darwin11 --enable-llvm = / private / var / tmp /llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix = i686-apple-darwin11- --host = x86_64-apple-darwin11 --target = i686-apple-darwin11 - with-gxx-include-dir = / usr / include / c ++ / 4.2.1
线程模型:posix
gcc版本4.2.1(基于Apple Inc. build 5658)(LLVM build 2335.15.00 )

然后我尝试创建另一个指向新路径的工具链,它位于Custom中,但我无法使用它。
我如何强制QT Creator使用另一个编译器(在我的情况下是GCC,但是在另一个PATH中)
我想迫使XCODE不需要更改编译器。
有没有办法做到这一点?

解决方案

在Qt Creator中进入

 工具 - >选项 - >构建和运行 - >编译器

然后添加一个新的gcc编译器。



<然后进入

 工具 - >选项 - >构建和运行 - >套件

并更改当前套件中的编译器(通常称为Desktop)。



您可能需要最新版本的Qt Creator和工具包(可从Qt Creator 2.6获得)。


I installed a gcc 4.8.0 in the /opt folder. I put in my PATH, so when i do a gcc/g++ -v it returns to me the 4.8.0 version. But when i go to the QT Creator and compile my program with the c++11 code (implemented in 4.3 > ) it don't compile. So i put a -v option in the QMAKE_CXXFLAGS flag. So i get:

Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

Then i tried to create another toolchain that points to the new path, it is in Custom, but i cannot use it. How can i force the QT Creator to use another compiler (in my case the GCC, but in another PATH) I want to force so the XCODE dont need to change the compiler too. Is there a way to do that?

解决方案

In Qt Creator go in

Tools -> Options -> Build&Run -> Compilers

then add a new gcc compiler.

Then go into

Tools -> Options -> Build&Run -> Kits

and change the compiler in your current kit (usually called "Desktop").

You may need latest versions of Qt Creator with "kits" (available from Qt Creator 2.6).

这篇关于Qt Creator使用位于另一个地方的另一个GCC版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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