4

I want to use gcc6 for my project and use qtcreator as ide. my project uses cmake.

in 'build&run' -> 'compiler' i added g++-6 as compiler 'gcc6'. in 'kits' i changed the compiler to 'gcc6'.

when importing the project and hovering over a target, the popup shows compiler as 'gcc6'.

when clicking 'configure' and running cmake i get following output:

-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works

and c++ is used when compiling. this is what i get when following the links:

/usr/bin/c++ -> /etc/alternatives/c++ -> /usr/bin/g++ -> g++-5

so it seems the qtcreator ignores my settings.

it would be enough to set default cmake-parameters for the qtcreator kit, but i found no option.

what can i do to fix this? (or am i doing something wrong?)

1
  • I'd guess the compiler setting in Creator is for qmake only, CMake might have its own idea on how to run the compiler. You probably have to put the compiler settings in the CMakeLists.txt file. Commented May 31, 2016 at 21:33

1 Answer 1

4

I also ran into this problem. Don't know what you can do to fix the Kit problem, but you can add the following to your pro file to point to another gcc and g++ version:

QMAKE_CC = gcc-4.8
QMAKE_CXX = g++-4.8
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.