Build qt source for MAC OS problem with finding standart C++ include files (SOLVED)
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.
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,
/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]’:
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?
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.
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.
I think I've found your problem
So your line should be something like:
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:
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,
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: *** [.obj/debug-static/qdnd_mac.o] Error 1
make: *** [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.
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 :)