Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. G++-4.2: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

G++-4.2: No such file or directory

Scheduled Pinned Locked Moved Installation and Deployment
17 Posts 7 Posters 19.7k 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.
  • E Offline
    E Offline
    Eonz
    wrote on last edited by
    #1

    I recently upgraded my MacOS X to Lion and then my XCode (which broke in the process) to 4.2.1 from the Mac App Store (I can't recall the version I used before). I haven't used Qt for a while on this computer but, trying to use today gave an error when building. I figured this needed a reinstall as well, so I made a completely new installation of Qt Desktop 4.7.4.

    I still get the following error in the issues pane when trying to build/run:

    g++-4.2: No such file or directory

    I'm sure something is just not set up correctly, but I have no idea where to look. I don't know if this is one of those command line things or if I can fix this using Qt Creator's settings.

    I'm very much noob when it comes to understanding how all those scattered files (make, qmake, gcc, g++ all that stuff) gets used by Qt Creator, so don't worry about stating the obvious, I won't be offended!

    Thanks in advance for any help.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      I'm not 100% sure, but AFAIK there have been some problems regarding XCode 4. I'm don't know if and when that has been sorted out.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • M Offline
        M Offline
        miroslav
        wrote on last edited by
        #3

        The problem is that g++-4.2 comes with the MacOs 10.6 SDK and is usually installed in /usr/bin. The default qmake spec is macx-g++42, and that points to this compiler. If the 10.6 SDK is not installed, that fails.
        The workaround on Mac Os 10.7 is to switch to the clang toolchain for now.

        Mirko Boehm | mirko@kde.org | KDE e.V.
        FSFE Fellow
        Qt Certified Specialist

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Eonz
          wrote on last edited by
          #4

          Thank you miroslav. I will try to do this. Do you know of any resources that describe the process?

          For the record, I have now duplicated the problem on the following configurations:

          MacOS 10.7.2 (Lion), XCode 4.2.1
          MacOS 10.6.8 (Snow Leopard), XCode 4.2

          Eon

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

            ... or you can force the mkspec used by passing a "-spec macx-g++" to the qmake step (which will override the one chosen by Qt Creator).

            ... or you can create a symlink from /usr/bin/g++ and /usr/bin/gcc to /usr/bin/g++-4.2 and /usr/bin/gcc-4.2

            ... or you could test http://codereview.qt-project.org/#change,11297 and tell me whether that fixes the issue.

            I would highly appreciate somebody trying the latter;-)

            1 Reply Last reply
            0
            • M Offline
              M Offline
              miroslav
              wrote on last edited by
              #6

              I think the underlying issue is the Creator defaults to the macx-g++42 make spec. So Tobias' suggestion to override that with macx-g++ is probably the best solution for now. The only resources that I know of are here in the forum.

              Mirko Boehm | mirko@kde.org | KDE e.V.
              FSFE Fellow
              Qt Certified Specialist

              1 Reply Last reply
              0
              • E Offline
                E Offline
                Eonz
                wrote on last edited by
                #7

                Thanks guys. I tried, but I honestly do not know how to do what you suggest. To "override that with macx-g++". Qt Creator's preferences doesn't seem to show anything like that so I'm guessing what you're suggesting requires more advance command line stuff.

                I tried Tobias' link, but a login is required for that (the one for this forum doesn't work for me).

                I can develop on my Windows machine for now.

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

                  Also "check here":http://developer.qt.nokia.com/forums/viewthread/12592/: Another thread about this topic, with a better explanation on how to override the mkspec.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    miroslav
                    wrote on last edited by
                    #9

                    Just submitted a review here, this seems to solve the problem: http://codereview.qt-project.org/#change,11297

                    Mirko Boehm | mirko@kde.org | KDE e.V.
                    FSFE Fellow
                    Qt Certified Specialist

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

                      ... and I just submitted the fix to the 2.4 branch. Thanks Miroslav for testing!

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        miroslav
                        wrote on last edited by
                        #11

                        My pleasure :-)

                        Mirko Boehm | mirko@kde.org | KDE e.V.
                        FSFE Fellow
                        Qt Certified Specialist

                        1 Reply Last reply
                        0
                        • ? This user is from outside of this forum
                          ? This user is from outside of this forum
                          Guest
                          wrote on last edited by
                          #12

                          To solve the problem:

                          When upgrading from 10.6 to 10.7, you can not uninstall Xcode to upgrade just because the g + + -4.2 to install xcode 4.2.

                          The steps are:

                          1 - keep the xcode 3.2, I'm not wrong.
                          install xcode 4.2 and above.

                          PS: If you uninstall the xcode 3.2 and xcode 4.2 install to make any kind of build in QT, you'll get errors (g + + -4.2 no such directory) or something like that.

                          2 - After upgrading to the Lion remains with the xcode 3.2, install the xcode 4.2 and 3.2 does not uninstall after install QT.

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            DomX
                            wrote on last edited by
                            #13

                            So I'm having the same issue, has this been resolved yet? I'm also running Mac OSX 10.7.2 with XCode 4.2.1

                            I tried following this link: http://codereview.qt-project.org/#change,11297 But it requires a username and password. Any help without having to do a clean install would be much appreciated,

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              maxvanceffer
                              wrote on last edited by
                              #14

                              I just add macx-g++ and error disappeared, but then make or g++ doesn't see all Qt classes, macros and etc.... Building from Qt creator, Mac Os 10.7, XCode 4.2

                              Any advice ?

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                alpha_one_x86
                                wrote on last edited by
                                #15

                                here with the spec macx-g++ that's not work!

                                The best way to do file copy is in Qt:
                                http://ultracopier.first-world.info/

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  miroslav
                                  wrote on last edited by
                                  #16

                                  Hi!

                                  [quote author="alpha_one_x86" date="1331383665"]here with the spec macx-g++ that's not work![/quote]

                                  Could you give a few more details on what exactly is not working?

                                  Mirko Boehm | mirko@kde.org | KDE e.V.
                                  FSFE Fellow
                                  Qt Certified Specialist

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    alpha_one_x86
                                    wrote on last edited by
                                    #17

                                    I have drop the MAC SDK version, because Qt 4.8 not work with xcode3, and with xcode4 SDK version is minimum 10.6

                                    The best way to do file copy is in Qt:
                                    http://ultracopier.first-world.info/

                                    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