Qt World Summit: Register Today!

Build qt source for MAC OS problem with finding standart C++ include files (SOLVED)

  • Hi,
    I am new to qt. Tried hard to build a static version of qt 4.8.5 on MAC OS X, but without success, please help.
    Clone from here: git://gitorious.org/qt/qt.git to get version 4.8.5.
    ran configure below, which has the correct -I path to the standard C++ include folder that has file "new", but ./configure could not find file "new" when it tried to build qmake. It seems "configure" ignored -I.

    ./configure -confirm-license -developer-build -arch x86 -L "/Developer/SDKs/MacOSX10.5.sdk/usr/lib/" -I "/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0" -I "/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/x86_64-apple-darwin9/bits" -I "/usr/include" -I "/usr/local/include" -I "/Developer/SDKs/MacOSX10.5.sdk/usr/include" -I "/Developer/SDKs/MacOSX10.5.sdk/usr/include/gcc/darwin/4.2" -optimized-qmake -nomake examples -nomake tests -opensource -static -no-qt3support -no-nis -no-svg -no-phonon -no-stl -no-javascript-jit -no-accessibility -no-dwarf2 -no-xmlpatterns -no-multimedia -no-audio-backend -no-webkit -no-cups -no-dbus -carbon -sdk "/Developer/SDKs/MacOSX10.5.sdk" -prefix /Developer/qt-src-4.8.5/mybuilds

    Got these messages:
    Creating qmake. Please wait...
    g++ -c -o project.o -arch i386 -pipe -DQMAKE_OPENSOURCE_EDITION -O2 -fconstant-cfstrings -isysroot /Developer/SDKs/MacOSX10.5.sdk -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -Igenerators/integrity -I/temp/qt/include -I/temp/qt/include/QtCore -I/temp/qt/src/corelib/global -I/temp/qt/src/corelib/xml -I/temp/qt/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/temp/qt/mkspecs/macx-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED project.cpp
    In file included from /temp/qt/include/QtCore/qiterator.h:1,
    from /temp/qt/include/QtCore/../../src/corelib/tools/qlist.h:45,
    from /temp/qt/include/QtCore/qlist.h:1,
    from /temp/qt/include/QtCore/../../src/corelib/tools/qstringlist.h:47,
    from /temp/qt/include/QtCore/qstringlist.h:1,
    from project.h:45,
    from project.cpp:42:
    /temp/qt/include/QtCore/../../src/corelib/tools/qiterator.h:50:79: error: new: No such file or directory
    /temp/qt/include/QtCore/../../src/corelib/tools/qlist.h: In member function ‘void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = QString]’:

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You shouldn't need to add any path to the sdk's include path. configure should set everything for you. Re-run configure without all these additional paths (but first, cleanup everything)

    Also, why are you doing a developer build with a prefix ? That defeats the purpose of the developer build. Either use a prefix (and make install at the end) or do a developer build.

  • Thank you for reply. I did as you instructed, but the problem not finding string.h is now appears. I wanted prefix because I need to static builds to work with MAC SDKs (10.4 thru 10.7). I forgot to mention I did install pre-built 4.8.5 version, if this cause problem I will uninstall and try again. Do you think I should uninstall the pre-build first?

  • SGaist,

    I need your expertise as a qt consultant, so please send me an email and I will reply with a detailed description of my projects.

    Thank you,


  • Lifetime Qt Champion

    Which version of Xcode are you using ?

    You can already send me the detail through the email form on my profile.

    I would advise you to remove your email address from your post. It's not protected.

  • I failed to send email thru your profile. Please send me an email through regular channel.

  • Lifetime Qt Champion

    I think I've found your problem

    @-sdk “/Developer/SDKs/MacOSX10.5.sdk”@

    should be

    @-sdk /Developer/SDKs/MacOSX10.5.sdk@

    So your line should be something like:
    @./configure -confirm-license -developer-build -arch x86 -optimized-qmake -nomake examples -nomake tests -opensource -static -no-qt3support -no-nis -no-svg -no-phonon -no-stl -no-javascript-jit -no-accessibility -no-dwarf2 -no-xmlpatterns -no-multimedia -no-audio-backend -no-webkit -no-cups -no-dbus -carbon -sdk /Developer/SDKs/MacOSX10.5.sdk@

    And since you might be doing different builds, you should do an out of source build, so you only have the sources once.

  • I tried your way:
    ./configure -confirm-license -developer-build -arch x86 -optimized-qmake -nomake examples -nomake tests -opensource -static -no-qt3support -no-nis -no-svg -no-phonon -no-stl -no-javascript-jit -no-accessibility -no-dwarf2 -no-xmlpatterns -no-multimedia -no-audio-backend -no-webkit -no-cups -no-dbus -carbon -sdk /Developer/SDKs/MacOSX10.5.sdk

    Same problem remains. But if I don't specify -sdk at all the build went further (configure completed no error), but after ran make for about 10 minuets, it halted with error,

    ./configure -confirm-license -optimized-qmake -nomake examples -nomake tests -opensource -static -no-qt3support -no-nis -no-svg -no-phonon -no-stl -no-javascript-jit -no-accessibility -no-dwarf2 -no-xmlpatterns -no-multimedia -no-audio-backend -no-webkit -no-cups -no-dbus -carbon -prefix /Developer/qt-src-4.8.5/mybuilds/10.5SDK

    gcc -c -pipe -g -arch i386 -arch i386 -Xarch_i386 -mmacosx-version-min=10.4 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_USE_BUNDLED_LIBPNG -DPNG_NO_ASSEMBLER_CODE -DMNG_BUILD_SO -DMNG_NO_INCLUDE_JNG -DQT_NO_CUPS -DQT_NO_LPR -DQT_NO_OPENTYPE -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_GTK -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_S60 -DQ_INTERNAL_QAPP_SRC -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/macx-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I.rcc/debug-static -Iimage -I../3rdparty/libpng -I../3rdparty/libjpeg -I../3rdparty/libmng -I../3rdparty/libtiff/libtiff -I../3rdparty/harfbuzz/src -Idialogs -I.moc/debug-static -I.uic/debug-static kernel/qdnd_mac.mm -o .obj/debug-static/qdnd_mac.o
    kernel/qdnd_mac.mm: In member function ‘Qt::DropAction QDragManager::drag(QDrag*)’:
    kernel/qdnd_mac.mm:628: error: ‘SetRect’ was not declared in this scope
    make[2]: *** [.obj/debug-static/qdnd_mac.o] Error 1
    make[1]: *** [debug-all] Error 2
    make: *** [sub-gui-make_default-ordered] Error 2

  • I found the problem! All I had to do was uninstall xcodelegacy.sh (extract older Mac sdks and install to Xcode 4), then build qt. Life is good now. Thank you.

  • Lifetime Qt Champion

    You're welcome !

    Since you have it working now, please update your thread title prepending [solved] so other forum users may know a solution has been found :)

Log in to reply