Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiler configuration for Qt Creator

I am new to Qt and its IDE Qt Creator so pardon my ignorance. When I try to compile my code I get the exception

"Qt Creator needs a compiler set up to build. Configure a compiler in the kit options".

I have installed MingGW for compiling C++ code. However, I am having a problem configuring it for Qt Creator.

Any help will be appreciated. Thanks

like image 567
Emelia Dede Quist Avatar asked Dec 20 '12 20:12

Emelia Dede Quist


People also ask

Is Qt Creator a compiler?

Qt Creator uses the C++ compiler from the GNU Compiler Collection on Linux. On Windows it can use MinGW or MSVC with the default install and can also use Microsoft Console Debugger when compiled from source code.

Does Qt support C ++ 11?

When you read that "Qt Creator supports C++11" it means that the code-completion engine (Clang in this case) supports C++11 syntax.


2 Answers

I suspect you are using the new 5.0 Qt. It required a bit of prodding for me too.

If you look into Settings > Build & Run > Kits you should see an auto-detected entry which will probably have an exclamation mark in front and is not editable. Ignore this.

  • Add a new Kit
  • Give it a name, set the "Qt version" and select a compiler. (Compilers should have been auto-detected. If you do not see any compilers, you will have to set at least one up manually)
  • Click the "Make Default" button. (You may have to modify project build settings to use the new Kit too)

There may be a better way, but I do not know it. And you should probably use 4.x until 5 is out of beta.

like image 126
dualed Avatar answered Oct 23 '22 22:10

dualed


I was also having the same problem, so what I did was this:

sudo apt-get install g++ 
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev

I then closed the QT Creator, restarted it, and it worked.

I do not know which of the above two made it work, but it worked!

like image 28
Mahmoud Abd El Samea Avatar answered Oct 23 '22 23:10

Mahmoud Abd El Samea