Important: Please read the Qt Code of Conduct -

Qt Creator changes compiler mid build

  • I am experimenting with Qt Creator 3.4.1 on OS X 10.0.3. I have MacPorts and GCC5 installed in the default location (/opt/local.....) The above path is in my .bash_profile. I can build this project in both Eclipse and Netbeans with GCC5 but am having issues with Creator. In Creator I have added a kit and set the compiler and debugger and it works mostly. When I build I get the correct compiler for all but 1 line (see below) Then it defaults to using g++ and my build fails (am using shared_ptr and C++11). Notice how it uses g++-mp-5 everywhere except the last line.

    Anyone with any ideas of how to fix this or what I am missing. It has to be something small and simple

    /Applications/"  -f nbproject/ dist/Debug/MP_GCC5-MacOSX/davisproad2tool
    mkdir -p build/Debug/MP_GCC5-MacOSX
    rm -f "build/Debug/MP_GCC5-MacOSX/DavisRecordParser.o.d"
    g++-mp-5    -c -g -I/opt/local/include/gcc5/c++/ -std=c++11 -MMD -MP -MF "build/Debug/MP_GCC5-MacOSX/DavisRecordParser.o.d" -o build/Debug/MP_GCC5-MacOSX/DavisRecordParser.o DavisRecordParser.cpp
    mkdir -p build/Debug/MP_GCC5-MacOSX
    rm -f "build/Debug/MP_GCC5-MacOSX/DavisWeatherRecord.o.d"
    g++-mp-5    -c -g -I/opt/local/include/gcc5/c++/ -std=c++11 -MMD -MP -MF "build/Debug/MP_GCC5-MacOSX/DavisWeatherRecord.o.d" -o build/Debug/MP_GCC5-MacOSX/DavisWeatherRecord.o DavisWeatherRecord.cpp
    mkdir -p build/Debug/MP_GCC5-MacOSX
    rm -f "build/Debug/MP_GCC5-MacOSX/DavisWeatherRecordRevA.o.d"
    g++-mp-5    -c -g -I/opt/local/include/gcc5/c++/ -std=c++11 -MMD -MP -MF "build/Debug/MP_GCC5-MacOSX/DavisWeatherRecordRevA.o.d" -o build/Debug/MP_GCC5-MacOSX/DavisWeatherRecordRevA.o DavisWeatherRecordRevA.cpp
    mkdir -p build/Debug/MP_GCC5-MacOSX
    rm -f "build/Debug/MP_GCC5-MacOSX/DavisWeatherRecordRevB.o.d"
    g++-mp-5    -c -g -I/opt/local/include/gcc5/c++/ -std=c++11 -MMD -MP -MF "build/Debug/MP_GCC5-MacOSX/DavisWeatherRecordRevB.o.d" -o build/Debug/MP_GCC5-MacOSX/DavisWeatherRecordRevB.o DavisWeatherRecordRevB.cpp
    mkdir -p build/Debug/MP_GCC5-MacOSX
    rm -f "build/Debug/MP_GCC5-MacOSX/EndianReader.o.d"
    g++-mp-5    -c -g -I/opt/local/include/gcc5/c++/ -std=c++11 -MMD -MP -MF "build/Debug/MP_GCC5-MacOSX/EndianReader.o.d" -o build/Debug/MP_GCC5-MacOSX/EndianReader.o EndianReader.cpp
    mkdir -p build/Debug/MP_GCC5-MacOSX
    rm -f "build/Debug/MP_GCC5-MacOSX/main.o.d"
    g++-mp-5    -c -g -I/opt/local/include/gcc5/c++/ -std=c++11 -MMD -MP -MF "build/Debug/MP_GCC5-MacOSX/main.o.d" -o build/Debug/MP_GCC5-MacOSX/main.o main.cpp
    mkdir -p dist/Debug/MP_GCC5-MacOSX
    g++-mp-5     -o dist/Debug/MP_GCC5-MacOSX/davisproad2tool build/Debug/MP_GCC5-MacOSX/DavisRecordParser.o build/Debug/MP_GCC5-MacOSX/DavisWeatherRecord.o build/Debug/MP_GCC5-MacOSX/DavisWeatherRecordRevA.o build/Debug/MP_GCC5-MacOSX/DavisWeatherRecordRevB.o build/Debug/MP_GCC5-MacOSX/EndianReader.o build/Debug/MP_GCC5-MacOSX/main.o 
    "/Applications/"  -f nbproject/ dist/Release/GNU-MacOSX/davisproad2tool
    mkdir -p build/Release/GNU-MacOSX
    rm -f "build/Release/GNU-MacOSX/DavisRecordParser.o.d"
    g++    -c -O2 -MMD -MP -MF "build/Release/GNU-MacOSX/DavisRecordParser.o.d" -o build/Release/GNU-MacOSX/DavisRecordParser.o DavisRecordParser.cpp
    In file included from DavisRecordParser.cpp:10:0:
    DavisRecordParser.h:33:5: error: 'shared_ptr' does not name a type
         shared_ptr<DavisWeatherRecordRevB> record = make_shared<DavisWeatherRecordRevB>();

    PS - I am using a generic Qt setup as per docs and not a .pro file

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The other thing that is strange is that you switch from a debug to a release build. Do you do something like that in your project somewhere ?

  • Thank you. Not that I have found or know of. I imported the original project from Netbeans. I will poke around and see if I see anything

Log in to reply