2

We are doing a C++ project for our uni and its final phase is passing the whole thing into a graphical interface using Qt.

We use Qt5.4 and g++-5. These values have been set in the QtCreator project configuration by selecting the appropriate compiler, g++-5, and also adding options in the *.pro file such as -std=c++14 and so on.

Nevertheless we are being stumped by an important issue. No matter what we try, when running qmake so as to auto-generate the precompiled files, in any Makefile generated by it, the compiler is ALWAYS set to g++ and not g++-5. We are at the moment obliged to after using qmake having to change by hand the compiler in the Makefile on our own, even though we have told it EVERYWHERE that we are using g++-5 and not the normal g++.

We have tried solutions like in this question: Using c++14

And also changing the compiler in the mkspecs of the Qt SDK.

Both have been to no avail and we still can't get the auto-generated Makefile to use g++-5 unless we change it by hand.

Is this a Qt issue or are we doing a step incorrectly?

Thanks in advance.

Community
  • 1
  • 1
Mixone
  • 1,327
  • 1
  • 13
  • 24
  • Have you already tried something similar to `export set CXX="g++-5"`? – JVApen Mar 13 '16 at 12:34
  • in the console you mean? i have tried setting exactly that in the .pro file though and it didn't help – Mixone Mar 13 '16 at 12:42
  • 1
    `qmake -o QMakefile "QMAKE_CXX=g++-5"` according to https://doc.qt.io/qt-5/qmake-variable-reference.html – Galik Mar 13 '16 at 13:07
  • done that as well: [Screenshot of .pro](http://postimg.org/image/ezhqh36sf/) – Mixone Mar 13 '16 at 13:13
  • AH! Sorry for all the bother hahaha It is solved now, I had linked my g++ compiler to g++-5 when I installed it ages ago but had forgotten (both g++ and g++-5 work on my pc, but they are the same) so it wasn't being an error, just my pc configuration getting in the way, thanks for the help though :D – Mixone Mar 13 '16 at 13:29

1 Answers1

0

Sorry for all the bother.

It is solved now, I had linked my g++ compiler to g++-5 when I installed it ages ago but had forgotten (both g++ and g++-5 work on my pc, but they are the same) so it wasn't being an error, just my pc configuration getting in the way, thanks for the help though.

Mixone
  • 1,327
  • 1
  • 13
  • 24