[PyQt] How to build PyQt4 as 32/64-bit on a Mac

Emanuele Santos emanuelesantos at gmail.com
Tue Aug 16 21:53:59 BST 2011


Hi,

I've installed Qt 4.7.3 Cocoa 32/64-bit libs on a Snow Leopard machine
that has XCode 3.2.6 installed.
I am using python 2.7.2 32/64-bit from python.org

I am trying to build a 2-way (32-bit/64-bit) installation of PyQt4 but
the configure step fails.

I've built sip 4.12.4 without errors using the commands:

$ python configure.py --arch=i386 --arch=x86_64
$ make
$ make install

When I try to build PyQt4-mac-gpl-4.8.5 it fails testing all the other
modules (QtGui QtHelp etc), with an error similar to:

ld: framework not found QtGui
collect2: ld returned 1 exit status
ld: framework not found QtGui
collect2: ld returned 1 exit status
lipo: can't open input file:
/var/folders/h9/h9It34qgGYOcx12sG2ZPyk+++TM/-Tmp-//ccAzLAHL.out (No
such file or directory)

This is the output up to the first error:

$ python configure.py -w
Determining the layout of your Qt installation...
/usr/bin/qmake -spec macx-g++ -o qtdirs.mk qtdirs.pro
make -f qtdirs.mk
g++ -c -pipe -g -gdwarf-2 -arch x86_64 -Xarch_x86_64
-mmacosx-version-min=10.5 -arch i386 -Wall -W -DQT_CORE_LIB
-DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I.
-I/Library/Frameworks/QtCore.framework/Versions/4/Headers
-I/usr/include/QtCore -I/usr/include -I. -F/Library/Frameworks -o
qtdirs.o qtdirs.cpp
g++ -headerpad_max_install_names -arch x86_64 -arch i386 -Xarch_x86_64
-mmacosx-version-min=10.5 -o qtdirs.app/Contents/MacOS/qtdirs qtdirs.o
  -F/Library/Frameworks -L/Library/Frameworks -framework QtCore
qtdirs.app/Contents/MacOS/qtdirs
This is the GPL version of PyQt 4.8.5 (licensed under the GNU General Public
License) for Python 2.7.2 on darwin.

Type '2' to view the GPL v2 license.
Type '3' to view the GPL v3 license.
Type 'yes' to accept the terms of the license.
Type 'no' to decline the terms of the license.

Do you accept the terms of the license? yes
Found the license file pyqt-gpl.sip.
Checking to see if the QtGui module should be built...
g++ -arch i386 -arch x86_64 -DQT_NO_DEBUG -DQT_GUI_LIB -I.
-I/mkspecs/macx-g++ -I/Library/Frameworks/QtGui.framework/Headers
-I/usr/include -pipe -arch i386 -arch x86_64 -isysroot
/Developer/SDKs/MacOSX10.6.sdk -O2 -w cfgtest_QtGui.cpp -o
cfgtest_QtGui -F/Library/Frameworks -L/Library/Frameworks
-headerpad_max_install_names -arch i386 -arch x86_64
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -framework QtGui
-framework QtCore
ld: framework not found QtGui
collect2: ld returned 1 exit status
ld: framework not found QtGui
collect2: ld returned 1 exit status
lipo: can't open input file:
/var/folders/h9/h9It34qgGYOcx12sG2ZPyk+++TM/-Tmp-//ccAzLAHL.out (No
such file or directory)


If I build sip as 64-bit only, all PyQt's tests pass and all the
modules are built without problems.

Has anybody got PyQt to build it as 32-bit and 64-bit successfully on
a Mac without building Qt from source?

Thanks,

-- Emanuele.


More information about the PyQt mailing list