Important: Please read the Qt Code of Conduct -

Unable to compile Qt4.8.6 on OSX 10.9.4

  • Hi,
    I have been trying to build Qt4.8.6 from source for a while but I keep getting broken results. Here is my configure command:

    ./configure -prefix /Users/me/myApps/Qt-4.8.6-clang-503.0.40 -release -opensource -arch x86_64 -I /Applications/

    But I get couple of errors and a warning:

    1 warning and 4 errors generated.
    make[4]: *** [.obj/release-shared/tst_qwebelement.o] Error 1
    make[3]: *** [release-install] Error 2
    make[2]: *** [sub-qwebelement-install_subtargets] Error 2
    make[1]: *** [sub-WebKit-qt-tests-install_subtargets-ordered] Error 2
    make: *** [sub-webkit-install_subtargets-ordered] Error 2

    ... and at the end, I get an incomplete folder and tool structure on the target path. I am comparing this to a previous build that I have built under OSX 10.6 using gcc (Qt-4.8.5-gcc-4.2.1) and this build is working just fine.

    To build the "Qt-4.8.5-gcc-4.2.1" I have built without any special flags. Any ideas about how to get a stable build process?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    @./configure -prefix /Users/me/myApps/Qt-4.8.6-clang-503.0.40 -release -opensource -nomake tests@

    should be enough.

    Unless you are developing Qt, you don't need to build the tests.

    Anyway, what exact error are you getting ?

    On a side note, you should rather do an out of source build, so if something fails you can restart from scratch by just deleting the build directory.

  • Hi SGaist,
    Thanks for the warm welcome and for your time. I am testing your suggestion right now.

    The reason for trying to point the ./configure script to the SDK include paths was because it was complaining about a header being missing (It was one of the many headers in the SDK include folder, after I passed the -I flag with the path, it stopped complaining about it.)

    As I already said, I am running the command you have suggested and there has not been any serious issues so far, will let you know about the result once it is done.


  • I got lots of warnings and the following at the end of make:
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[3]: *** [] Error 1
    make[2]: *** [sub-capabilities-install_subtargets-ordered] Error 2
    make[1]: *** [sub-phonon-install_subtargets] Error 2
    make: *** [sub-examples-install_subtargets-ordered] Error 2

    and the files at the target path are incomplete, I do not have "quake" in the bin folder :) But I got more files than the last time.

    Any ideas?


    P.S (1): This time I have built in a "build" folder, so I will try to dig out some logs and provide some more information about the errors.

    P.S (2): By the way, the folder in which I built has more files and seems more intact than the prefix folder. At least qmake is there. I will need to run some tests.

  • Lifetime Qt Champion

    Something strange here…

    To go the quick route, build with the 10.8 sdk rather that 10.9

    add -sdk macosx10.8 to the configure command line (start from scratch)

  • Hello,

    Thanks! Sure. Trying from scratch with -sdk 10.8 now. Will let you know.

    This is really annoying however, the build process should just work. I mean, I have Qt5 built in the same way, and I never had issues with it.

    The funny bit is that I also have "Qt-4.8.5-gcc-4.2.1" compiled with an old Xcode and on an old OSX (10.6) and it works like charm under my OSX 10.9.4 system, despite the fact that it is compiled with the old GCC and not the new Clang. I managed to build even the PyQt4 bindings based on that one. And I remember doing that cause I was never successful in building Qt4 with clang.

    Lets see how it goes this time, it should be possible.


  • Lifetime Qt Champion

    Clang and GCC are binary compatible IIRC

    Is it me or are you having problem during the install phase ?

  • Well, yeah I mean, maybe it is SDK 10.6 compared to SDK 10.8/9. Anyway, I am running the ./configure stage now.

    I have used the following command:

    @./qt-everywhere-opensource-src-4.8.6/configure -prefix /Users/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40 -sdk /Applications/ -release -opensource -nomake tests@

    This is what I get .qmake.cache file:

    To me it looked like a clean process, here is some more bits and pieces from my terminal:

    I am moving to the "make" part now.

  • I completed the "make" stage with the following errors:

    @Undefined symbols for architecture x86_64:
    "_CWKeychainCopyEAPIdentity", referenced from:
    QCoreWlanEngine::connectToId(QString const&) in qcorewlanengine.o
    "_CWKeychainCopyEAPUsernameAndPassword", referenced from:
    QCoreWlanEngine::connectToId(QString const&) in qcorewlanengine.o
    "_CWKeychainCopyPassword", referenced from:
    QCoreWlanEngine::connectToId(QString const&) in qcorewlanengine.o
    "_CWPowerDidChangeNotification", referenced from:
    -[QNSListener init] in qcorewlanengine.o
    "OBJC_CLASS$_CWInterface", referenced from:
    objc-class-ref in qcorewlanengine.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[4]: *** [../../../../plugins/bearer/libqcorewlanbearer.dylib] Error 1
    make[3]: *** [release] Error 2
    make[2]: *** [sub-corewlan-make_default] Error 2
    make[1]: *** [sub-bearer-make_default] Error 2
    make: *** [sub-plugins-make_default-ordered] Error 2@

    Ah, every time it is something different, let see if this goes through the "make install" stage.

  • No, this did not work unfortunately.

    Most of the stuff did not make it across into the prefix folder. Not sure that the stuff in the build folder is healthy as well.

  • Yeah, it has not worked. When I have the GCC built Qt4.8.5 in my environment my example Qt project builds just fine.

    When I switch to my new build Qt4.8.6 I get this when I try to build my simple example Qt project:

    @g++ -c -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/mkspecs/default -I. -I/broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/lib/QtCore.framework/Headers -I/broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/include/QtCore -I/broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/lib/QtGui.framework/Headers -I/broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/include/QtGui -I/broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/include -I. -I. -F/Users/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/lib -o qtWidgetTest.o qtWidgetTest.cpp
    In file included from qtWidgetTest.cpp:2:
    In file included from /broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/lib/QtGui.framework/Headers/QApplication:1:
    In file included from /broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/lib/QtGui.framework/Headers/qapplication.h:45:
    /broadcast/myUser/apps/Darwin64/Qt-4.8.6-clang-503.0.40/include/QtCore/qcoreapplication.h:1:10: fatal error: '../../../qt-everywhere-opensource-src-4.8.6/src/corelib/kernel/qcoreapplication.h' file not found
    #include "../../../qt-everywhere-opensource-src-4.8.6/src/corelib/kernel/qcoreapplication.h"
    1 error generated.
    make: *** [qtWidgetTest.o] Error 1@

    It seems like it it still looking for stuff in the src folder. This is really messed up.

  • Lifetime Qt Champion

    Did you do a make install after the build ?

  • Sure.

    First, the "./configure" stuff... then "make" and that last is "make install".

    I am might need to give up on this (again) as I am running out of troubleshooting time, unfortunatelly. I installed the pre-compiled Qt4.8.6 package through the installation, and although I hate the idea, I will have to stick to it. I cannot understand why building Qt4.8.6 is such a pain. It has always been panful.

    Thanks for your help and for your time, at least we tried :)


  • Lifetime Qt Champion

    Even with just

    @./configure -release -opensource -nomake tests -sdk macosx10.8@


    Note the -sdk parameter, it's not the full path to the SDK root

  • Hi,

    I was providing the full SDK path with the configure. Ok, I will try the latest command one more time. But I need to provide a prefix path as well, as I have already installed Qt4 into the standart locations. So I will just add the prefix flag and a location? Actually, I can build it inside a build folder and run "make" and "make install" in that folder? Sorry geting a bit confused.

    Thanks for your help,

  • Lifetime Qt Champion

    Yes you can add the prefix.

    Yes you can without any problem. The advantage of an out of source build comes if want to do multiple different builds (e.g different plugins/built in or not etc.), you'll have to clean + configure + build. With an out of source build, you can re-use the same sources.

  • Here's my notes on compiling the latest packaged Qt4/Qt5 with the latest OSes and compilers, I used that on multiple machines already and this is used for our production releases:

    Providing the full sdk path works. Differences I see is the export PATH at the beginning (this is to avoid things like macports to interfere) and the modification to

  • Hi,

    I am getting a bit confused here as the flag -sdk has been used with a full path pointing to the SDK folder and and sometimes with just the SDK name.

    Let me make my self a bit more clear before going on and trying this again.

    I would like to compile Qt4 myself, as I do not like the way things are scattered around in the /Developer folder with symbolic links created into /usr/local and etc. and etc.

    I would like to compile the standard package of Qt4, into my own custom prefix, so everything stays together (headers, bins etc.) avoiding stripping components as much as possible.

    I will now try to come up with a new ./configure command line, try this process again and report the results here.


  • Don't confuse Qt4 and Qt5, they are quite different. Full path for Qt4, name only for Qt5.

  • Lifetime Qt Champion

    @ sandy.martel What do you mean by "Full path for Qt4, name only for Qt5" ?

  • For the sdk.

  • Hi,

    My latest command:
    @./configure -release -opensource -nomake tests -no-qt3support -prefix /Users/myApps/Qt-4.8.6-clang-503.0.41 -sdk /Applications/ -arch x86_64@

    Unfortunately with no luck.

    By the way, sandy.martel is right about the -sdk flag, did not work when I used only "macosx10.8", as seen above, had to provide the full path.

    But anyway, still no success. Incomplete build and a partial install to the prefix folder. No working Qt4 at the end of the process.

    I would like to thank all of you for trying to help me, I think I will try to make things work with the default Qt4 install. Although having Qt4 as a framework in "/Library/Frameworks" seems to be destine for other issues.

  • Lifetime Qt Champion

    What version of Xcode are you using ?

Log in to reply