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

Qt Creator and GCC 4.6 on Mac

Scheduled Pinned Locked Moved Qt Creator and other tools
14 Posts 5 Posters 12.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.
  • 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