Compile errors trying to build the Qt v5.4.2 source kit on a Mac
As the title suggests, I'm trying to build Qt v5.4.2 from the "Qt everywhere" source kit on a Mac. I first ran the configure script with "./configure -platform macx-g++". Then I ran "make".
Before too long I got the following error:
/Developer/usr/bin/gcc -c -pipe -g -isysroot /Developer/SDKs/MacOSX10.6.sdk -mma
cosx-version-min=10.7 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -
DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_USING_NAMESPACE -DQT_BUILD_CO
RE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_
COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_
BEFORE=0x050000 -DPCRE_HAVE_CONFIG_H -DQT_NO_ICONV -DQT_CORE_LIB -D_LARGEFILE64_
SOURCE -D_LARGEFILE_SOURCE -I. -I../../include -I../../include/QtCore -I../../in
clude/QtCore/5.4.2 -I../../include/QtCore/5.4.2/QtCore -Iglobal -I../3rdparty/pc
re -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/
sha3 -I.moc/debug -I../../mkspecs/macx-g++ io/qfilesystemwatcher_fsevents.mm -o
io/qfilesystemwatcher_fsevents.mm: In member function 'void QFseventsFileSystemW
atcherEngine::processEvent(const __FSEventStream*, size_t, char**, const FSEvent
StreamEventFlags*, const FSEventStreamEventId*)':
io/qfilesystemwatcher_fsevents.mm:263: error: 'kFSEventStreamEventFlagItemIsDir'
was not declared in this scope
io/qfilesystemwatcher_fsevents.mm:263: error: 'kFSEventStreamEventFlagItemRemove
d' was not declared in this scope
make: *** [.obj/debug/qfilesystemwatcher_fsevents.o] Error 1
make: *** [debug-all] Error 2
make: *** [sub-corelib-make_first] Error 2
make: *** [sub-src-make_first] Error 2
make: *** [module-qtbase-make_first] Error 2
What version of OS X? I am not experienced on a Mac so I am assuming 10.6 based on the MacOSX10.6.sdk in the first line of the error message. I see that Qt 5.3 is the last officially supported version for OS X 10.6. Perhaps that is the problem.
Otherwise, make sure your build environment is setup correctly to find
<CoreServices/CoreServices.h>. Maybe someone here with experience building Qt on a Mac can provide more specific details on how to do that.
When I do "uname -a", I get this:
Darwin goomba 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011;
I'm not much of an expert on the Mac either, but I assume this means the machine is running v10.8. I suspect the Qt build is trying to use the 10.6 SDK regardless.
INote that a build of Qt v4.8.6 earlier on this system system did not have problems.
Because Qt 4.8.6 is relatively old and the IIRC the minimum SDK version needed to build Qt 5.4 is 10.7 (thought it can run on 10.6)
What version of Xcode do you have installed ?
Well, that's what uname -a shows. If I logon to the Mac using VNC and look at the "About this Mac" information, it tells me it's running OS X v10.6.8. So perhaps that is the problem.
The Xcode version appears to be v3.2.6 (1761).
At the risk of sounding daft, what is Xcode? I'm very unfamiliar with the Mac.
You should be able to build Qt 5.3 with your current setup. To build later versions, I don't know if you can just upgrade Xcode to get the OS X 10.7 SDK or if you need to upgrade your OS X, as well. @SGaist , or someone else here with Mac knowledge can probably answer that.
You can read about Xcode here, but basically it provides the SDKs and toolchains to build apps for Mac and iOS.
Xcode is also the development environment and provides tools like memory checking and performance analysis.
IIRC that's correct. The 5.3 series is the last officially building on 10.6 but you can still run applications build with later version on 10.6.
You can only upgrade Xcode that much, e.g. Xcode 6 requires 10.9
By the way, why do you need to build Qt yourself ?
We actually don't need to build it ourselves. In fact I have a separate post about errors trying to install the .dmg file. It appears to be related to the fact that we're running OS X 10.6, so we're looking into upgrading OS X. Applications that use Qt have already been built with Qt v5.4 on other platforms, so downgrading to Qt v5.3 isn't desirable.
A co-worker who has since left our company installed Qt v5.4 on a couple of Linux platforms by building the source kit. Since the Mac is kind of sort of Linux-like, I just thought I'd try that approach first.
I know the problem. Apple's philosophy is always develop with the latest version of OS X and Xcode which is not always ideal. Just keep in mind that with El Capitan coming up, jumping to only Lion or Mountain Lion might not be enough on the long run.