Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator and GCC 4.6 on Mac
Forum Updated to NodeBB v4.3 + New Features

Qt Creator and GCC 4.6 on Mac

Scheduled Pinned Locked Moved Qt Creator and other tools
14 Posts 5 Posters 11.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    objectref
    wrote on last edited by
    #3

    Thanks for the reply!

    My mac is at home and when i get back (at the afternoon) i will post back all the output needed.

    1 Reply Last reply
    0
    • O Offline
      O Offline
      objectref
      wrote on last edited by
      #4

      Ok, the Compiler Output is this:


      22:36:22: Running build steps for project eSTL1...
      22:36:22: Configuration unchanged, skipping qmake step.
      22:36:23: Starting: "/usr/bin/make" -w
      make: Entering directory /Users/objectref/Projects/tests/C++/eSTL1-build-desktop-Desktop_Qt_4_7_4_for_GCC__Qt_SDK__Debug' g++ -c -pipe -std=c++0x -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -I../../../../QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/macx-g++ -I../eSTL1 -I../eSTL1 -I. -o main.o ../eSTL1/main.cpp cc1plus: error: unrecognized command line option "-std=c++0x" make: *** [main.o] Error 1 make: Leaving directory /Users/objectref/Projects/tests/C++/eSTL1-build-desktop-Desktop_Qt_4_7_4_for_GCC__Qt_SDK__Debug'
      22:36:23: The process "/usr/bin/make" exited with code 2.
      Error while building project eSTL1 (target: Desktop)
      When executing build step 'Make'

      I understand that["cc1plus: error: unrecognized command line option "-std=c++0x"] is the error but the same command option is working fine under command line.

      I am sure i am missing something obvious here...

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on last edited by
        #5

        It might be using the wrong g++ then. Can you please check the PATH in Projects->Build Settings, Build Environment?

        1 Reply Last reply
        0
        • O Offline
          O Offline
          objectref
          wrote on last edited by
          #6

          Xmmm...it says: "/opt/local/bin:/Users/objectref/QtSDK/Desktop/Qt/4.8.0/gcc/bin:/usr/bin:/bin:/usr/sbin:/sbin"

          EDIT: I instructed to run g++-mp-4.6, not g++ (through the Toolchain addition that i made) but qmake "effective call" goes like this: "qmake /Users/objectref/Projects/tests/C++/eSTL1/eSTL1.pro -r -spec macx-g++ CONFIG+=declarative_debug"

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Duck
            wrote on last edited by
            #7

            You should at least use QMAKE_CXXFLAGS += ...

            Just "=" overwrites anything that was already there.

            1 Reply Last reply
            0
            • O Offline
              O Offline
              objectref
              wrote on last edited by
              #8

              Hi,

              i am indeed use it in .pro file as you say. (It was just a typo in my above post.)

              So, my .pro file is:

              QMAKE_CXXFLAGS += -std=c++0x
              TEMPLATE = app
              CONFIG += console
              CONFIG -= qt
              SOURCES += main.cpp

              Any ideas of what is going on ?

              EDIT: i use the "+" before the "=" but when i post to the forum i only get the "=" (an the rest) underlined!!

              1 Reply Last reply
              0
              • O Offline
                O Offline
                objectref
                wrote on last edited by
                #9

                In /opt/local/bin there is g++ (gcc 4.2) as well as g++-mp-4.6 (gcc 4.6). It seems to insist calling g++ and not g++-mp-4.6 even though in toolchain i specifically selected the second one...

                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  objectref
                  wrote on last edited by
                  #10

                  Hi again!

                  Does anyone find a solution to this ?

                  Thanks for any help!

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    tobias.hunger
                    wrote on last edited by
                    #11

                    Yeap, qmake will call whatever the mkspec tells it to, there is little we can do to override that from Qt Creator:-(

                    You can either install the different gccs into separate directories to work around the issue or add a new mkspec that uses the correct compiler to your Qt and ask creator to use that one. You can then override the mkspec used in your project or (with a creator from master) override the mkspec in the tool chain.

                    1 Reply Last reply
                    0
                    • O Offline
                      O Offline
                      objectref
                      wrote on last edited by
                      #12

                      Ok Tobias, thanks for the help!

                      I will follow your instructions. Still, i was expecting something less complicated...

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        stephenju
                        wrote on last edited by
                        #13

                        You can try MacPorts select command to make gcc46 the default gcc from opt/:
                        @
                        $ sudo port select gcc mp-gcc46@

                        Creator will than be able to pass -std=c++0x to the correct compiler. Note that -arch option is not available in non-Apple gcc. With Creator 2.5 RC, it insists on adding CONFIG+=x86_64 to qmake step, which in turn causes gcc to error on -arch option.

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          Petrodynamics
                          wrote on last edited by
                          #14

                          I'm stuck just getting started with the example using creator on the Mac.

                          #include <QApplication>
                          #include <QDialog>

                          #include "ui_gotocelldialog.h"

                          int main(int argc, char *argv[])
                          {
                          QApplication app(argc, argv);

                          Ui::GoToCellDialog ui;
                          QDialog dialog = new QDialog;
                          ui.setupUi( dialog ); //compile error here: no matching function for call to 'UI::GoToCellDialog::setupUi(QDialog
                          &)'
                          // ui.setupUi( (QMainWindow*)dialog ); //Mac compiler needs the typecast to QMainWindow
                          // to compile but encountered EXC_BAD_ACCESS on runtime
                          dialog->show();

                          return app.exec();
                          }

                          from ui_gotocelldialog.h

                          void setupUi(QMainWindow *GoToCellDialog)
                          

                          Any thoughts are much appreciated!

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved