Qt 5.1.1 Ubuntu的编译器设置

时间:2021-11-17 12:33:55

First of all, I should point out that I've never used linux before.

首先,我应该指出我以前从未使用过linux。

I have a clean install of 64bit ubuntu, I downloaded Qt 5.1.1 for linux 64 bit from http://qt-project.org/downloads, ran the .run file, installed it and gcc which is included in that download, opened Qt Creator, made a new project and tried to compile it. It wont compile and I keep getting this error message

我已经安装了64位ubuntu,我从http://qt-project.org/downloads下载了Qt 5.1.1的linux 64位,运行了。run文件,安装了。它无法编译,我不断得到这个错误消息

:-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options.

错误:Qt创建者需要一个编译器来构建。在套件选项中配置编译器。

I added a gcc compiler, but what do I need to put for the compiler path, platform codegen flags, platform linker flags and ABI?

我添加了一个gcc编译器,但是我需要为编译器路径、平台代码生成标记、平台链接器标记和ABI放置什么?

2 个解决方案

#1


0  

You don't have to input the path of your compiler because gcc and g++ paths are available in the $PATH enovironment variable. So just use "gcc" and "g++" and that should work. Just make sure you restart Qt Creator after the installation of g++.

您不必输入编译器的路径,因为gcc和g+路径在$ path enovironment变量中是可用的。所以只要使用“gcc”和“g++”就可以了。请确保在安装了g++之后重新启动Qt创建者。

One more thing. You need a compiled version of Qt installed on your computer. So also install Qt libraries with

一件事。您需要在您的计算机上安装一个编译版本的Qt。所以也要安装Qt库

sudo apt-get install qt4-dev-tools 

If you want to use the new version of the library you have to add it to $PATH. You can do this in the terminal with

如果您想使用新版本的库,您必须将它添加到$PATH中。你可以在终端上做这个

export PATH=/path/to/Qt/qtbase:$PATH

And then run Qt Creator from the same terminal, in which you did the last command.

然后从相同的终端运行Qt创建者,在该终端中执行最后一个命令。

Good luck!

好运!

#2


0  

You will have to install the dependencies as well. I got it working when I followed the steps in the following link.
Try this: http://wiki.qt.io/Building_Qt_5_from_Git

您还必须安装依赖项。当我按照以下链接中的步骤操作时,它就开始工作了。试试这个:http://wiki.qt.io/Building_Qt_5_from_Git

#1


0  

You don't have to input the path of your compiler because gcc and g++ paths are available in the $PATH enovironment variable. So just use "gcc" and "g++" and that should work. Just make sure you restart Qt Creator after the installation of g++.

您不必输入编译器的路径,因为gcc和g+路径在$ path enovironment变量中是可用的。所以只要使用“gcc”和“g++”就可以了。请确保在安装了g++之后重新启动Qt创建者。

One more thing. You need a compiled version of Qt installed on your computer. So also install Qt libraries with

一件事。您需要在您的计算机上安装一个编译版本的Qt。所以也要安装Qt库

sudo apt-get install qt4-dev-tools 

If you want to use the new version of the library you have to add it to $PATH. You can do this in the terminal with

如果您想使用新版本的库,您必须将它添加到$PATH中。你可以在终端上做这个

export PATH=/path/to/Qt/qtbase:$PATH

And then run Qt Creator from the same terminal, in which you did the last command.

然后从相同的终端运行Qt创建者,在该终端中执行最后一个命令。

Good luck!

好运!

#2


0  

You will have to install the dependencies as well. I got it working when I followed the steps in the following link.
Try this: http://wiki.qt.io/Building_Qt_5_from_Git

您还必须安装依赖项。当我按照以下链接中的步骤操作时,它就开始工作了。试试这个:http://wiki.qt.io/Building_Qt_5_from_Git