PDA

View Full Version : Building a universal binary with qmake on intel-based MacoSX



stephane
29th May 2007, 06:28
Hi,

I hope this is the proper section for my problem.
I'm trying to build my Qt.4.2.3-based project for both intel
and powerpc architectures on my intel-based macbook
running MacOSX 10.4.9.
I compiled Qt with the -universal option and put in
the .pro file of my project the following line:

CONFIG += x86 ppc

I get the following compile error:

cc1plus: error: invalid option 'arch=i686'
lipo: can't open input file: /var/tmp//ccgFDKSE.out (No such file or directory)
make: *** [../../build/macosx/release/obj/Exception.o] Error 1

with the following compile line:

c++ -c -pipe -Wno-deprecated -O3 -funroll-loops -fomit-frame-pointer -ffast-math -march=i686 -arch ppc -arch i386 -w -F/usr/local/Trolltech/Qt-4.2.3/lib -fPIC -DMACOSX -DQT_NO_DEBUG -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.2.3/mkspecs/macx-g++ -I. -I/usr/local/Trolltech/Qt-4.2.3/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.2.3/include/QtCore -I/usr/local/Trolltech/Qt-4.2.3/include/QtCore -I/usr/local/Trolltech/Qt-4.2.3/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.2.3/include/QtGui -I/usr/local/Trolltech/Qt-4.2.3/include/QtGui -I/usr/local/Trolltech/Qt-4.2.3/lib/QtOpenGL.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.2.3/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.2.3/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.2.3/lib/QtXml.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.2.3/include/QtXml -I/usr/local/Trolltech/Qt-4.2.3/include/QtXml -I/usr/local/Trolltech/Qt-4.2.3/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -I. -I. -o ../../build/macosx/release/obj/Exception.o ../system/Exception.cpp

Apparently it is the combination of the "-march=i686" and "-arch ppc" options that's causing the error (removing one or the other fixes it). I thought I would just get qmake not to add the "-march=i686" option but I can't find where it's coming from.
Has anybody else experienced that problem before? Did I miss a step when compiling Qt? Is there a way to prevent qmake from adding the march option in the Makfile?
Any help is welcome :-)
Thanks!

Stephane