LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-31-2019, 11:31 PM   #1
sharky
Member
 
Registered: Oct 2002
Posts: 537

Rep: Reputation: 74
qt-creator Cannot run compiler 'g++'


General messages in qt-creator after setting up first project.

Quote:
/usr/lib64/qt5/mkspecs/features/toolchain.prf(70): system(execute) requires one or two arguments.
Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment?
Error while parsing file /home/$USER/scripts/$PROJ/$PROJ/$PROJ.pro. Giving up.
Verified g++ from a terminal by compiling a simple hello world. If there is a place in qt-creator to point to the compiler I can't find it.

centos 7.6
qt-creator 4.1.0

This worked out of the box in a mint linux install but I need to run this in centos for work.

Any idea what might be wrong? I've done pyqt stuff before but I'm a total newbie to c++/qt. Assume I know nothing.

Thanks in advance.
Cheers,
 
Old 06-01-2019, 12:25 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Apples
Distribution: Apple-selling shops, markets and direct marketing
Posts: 1,118
Blog Entries: 29

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
In the qt-creator sidebar, click on Projects. On the left of the new window, you click on the button “Manage Kits”. Select the Kit/Qt-version of your choice and verify the settings.

Normally all this is configured automatically and I cannot know why it did not for your project.
 
1 members found this post helpful.
Old 06-01-2019, 12:27 AM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,586
Blog Entries: 11

Rep: Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617
I have never used QT_Creator, but a quick search tunred up this page in the docs, Adding Compilers as the first hit. It indicates that most times this is configured automatically, but you can set multiple compilers manually.
 
Old 06-02-2019, 12:01 PM   #4
sharky
Member
 
Registered: Oct 2002
Posts: 537

Original Poster
Rep: Reputation: 74
Quote:
Originally Posted by Michael Uplawski View Post
In the qt-creator sidebar, click on Projects. On the left of the new window, you click on the button “Manage Kits”. Select the Kit/Qt-version of your choice and verify the settings.

Normally all this is configured automatically and I cannot know why it did not for your project.
There is no 'Auto-detected' kit. There is a 'Manual' kit listed but I do not recall setting it up.

These are the properties of the 'Manual' kit.

Quote:
Name: Desktop
File system name: <blank>
Device type: Desktop
Device: Local PC (default for Desktop)
Sysroot: <blank>
Compiler: GCC (x86 64bit in /usr/bin)
Environment: No changes to apply.
Debugger: System GDB at /usr/bin/gdb
Qt version: Qt 5.9.2 in PATH (System)
Qt mkspec: <blank>
CMake Tool: System CMake at /usr/bin/cmake
CMake Generator: CodeBlocks - Unix Makefiles
CMake Configuration CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable}; QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
I don't understand most of that.
 
Old 06-02-2019, 01:15 PM   #5
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Apples
Distribution: Apple-selling shops, markets and direct marketing
Posts: 1,118
Blog Entries: 29

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
Quote:
Originally Posted by sharky View Post
There is a 'Manual' kit listed but I do not recall setting it up.
In your configuration the C++ compiler is missing. The executable in this case is not called gcc, but g++. Usually a second line is at display for “Compiler”. If you know that g++ is available, try the button “Manage”, then “Add”.

Okay. As the situation is unknown to me, I can only suggest a Trial&Error approach. Once the compiler is definitely installed and added to the kit, or a different one, open your project in Qt-Creator. There should be an icon on the outer left edge of the window, the fourth from the bottom, naming your currently opened project. Clicking that, the available kits are listed, in your case at least one should appear. Try to select it, even if there is only one kit available; release or debug should not make much difference.
 
1 members found this post helpful.
Old 06-03-2019, 08:53 PM   #6
sharky
Member
 
Registered: Oct 2002
Posts: 537

Original Poster
Rep: Reputation: 74
Apparently the compiler was running the whole time despite the error message.

Opened a terminal looked in the build directory and there was a compiled executable than ran like a charm.

So the qt-creator has an issue but it's not the issue I thought.

Not sure if I should mark this a solved or not.
 
Old 06-03-2019, 09:33 PM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,586
Blog Entries: 11

Rep: Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617
Quote:
Originally Posted by sharky View Post
Not sure if I should mark this a solved or not.
There are no hard and fast rules for that, but whenever your own interest in it has been satisfied it would be appreciated and would signal others that you are at an end point with it.

Thanks, and good luck!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugging in QT Creator cannot step in the shared library 5883 Linux - Newbie 0 12-22-2013 01:45 AM
checking for C compiler default output... configure: error: C compiler cannot create clubbing80s Linux - Software 3 07-05-2010 08:17 PM
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
error: "c compiler cannot create executables" when trying to run ./configure fedoraemu Linux - Software 2 04-24-2007 07:43 PM
C compiler cannot run C compiled programs petero Programming 8 05-27-2005 11:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration