Domanda

Ho appena compilato l'ultima anteprima di Qt4.6 su Snow Leopard a 64 bit senza problemi importanti.

http: // qt .nokia.com / developer / QT-4.6-tecnologia-preview # download-the-qt-4-1

Ora sto provando a fare lo stesso per PyQt4.6 con l'ultima istantanea dal sito web di River Bank. Tuttavia, il compilatore esce con il seguente problema:

g++ -c -pipe -fPIC -arch x86_64 -O2 -Wall -W -DNDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB -I. -I/Users/drufat/Downloads/PyQt-mac-gpl-4.6-snapshot-20090914/qpy/QtCore -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/usr/local/Trolltech/Qt-4.6.0/mkspecs/default -I/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers -I/usr/local/Trolltech/Qt-4.6.0/include -F/Users/drufat/Downloads/PyQt-mac-gpl-4.6-snapshot-20090914/qpy/QtCore -F/usr/local/Trolltech/Qt-4.6.0/lib -o sipQtCoreQResource.o sipQtCoreQResource.cpp
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h: In copy constructor ‘QResource::QResource(const QResource&)’:
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:180: error: ‘QScopedPointer<T, Cleanup>::QScopedPointer(const QScopedPointer<T, Cleanup>&) [with T = QResourcePrivate, Cleanup = QScopedPointerDeleter<QResourcePrivate>]’ is private
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qresource.h:59: error: within this context
sipQtCoreQResource.cpp: In constructor ‘sipQResource::sipQResource(const QResource&)’:
sipQtCoreQResource.cpp:78: note: synthesized method ‘QResource::QResource(const QResource&)’ first required here 
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h: In static member function ‘static void QScopedPointerDeleter<T>::cleanup(T*) [with T = QResourcePrivate]’:
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:100:   instantiated from ‘QScopedPointer<T, Cleanup>::~QScopedPointer() [with T = QResourcePrivate, Cleanup = QScopedPointerDeleter<QResourcePrivate>]’
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qresource.h:59:   instantiated from here
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:59: error: invalid application of ‘sizeof’ to incomplete type ‘QResourcePrivate’ 
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:59: error: creating array with negative size (‘-0x00000000000000001’)
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:60: error: invalid application of ‘sizeof’ to incomplete type ‘QResourcePrivate’ 
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:60: error: creating array with negative size (‘-0x00000000000000001’)
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:62: warning: possible problem detected in invocation of delete operator:
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:54: warning: ‘pointer’ has incomplete type
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qresource.h:56: warning: forward declaration of ‘struct QResourcePrivate’
/usr/local/Trolltech/Qt-4.6.0/lib/QtCore.framework/Headers/qscopedpointer.h:62: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.

È un errore con PyQt4 che tenta di accedere a un membro privato di una classe Qt4? Qualcuno ha compilato PyQt4 su Snow Leopard con successo?

È stato utile?

Soluzione

Ho appena fatto funzionare PyQt 4.6.2 con Python 2.6.1 a 64 bit. Ho pubblicato le istruzioni qui: http: / /mpastell.com/2009/11/24/pyqt-4-6-2-with-snow-leopard/

Altri suggerimenti

Nei log delle modifiche vedo Phil (manutentore di PyQt) ha rilasciato correzioni ieri nelle istantanee di sviluppo specifiche per Snow Leopard:

  

2009/09/14 12:12:49 phil Inoltre   correzioni per Snow Leopard a 64 bit   sistemi. aggiunto   QObject.pyqtConfigure ().

Stai usando la build di PyQt di ieri?

Questa discussione sulla mailinglist è anche particolarmente interessante.

I problemi di compilazione di PyQt sembrano essere causati dalle compilazioni predefinite a 64 bit di Snow Leopards e dalla versione mista a 64/32 bit di Python con cui viene fornita.

Se le cose continuano a andare male, vorrei inviare i tuoi problemi a questa mailing list (in modo che possano essere risolti - si spera) e provare a (temporaneamente) ricostruire Qt e PyQt (e possibilmente python) in modo a 32 bit (con il flag del compilatore -m32) se ne hai bisogno che funzioni ora.

Potresti voler usare PyQt dal progetto homebrew: build semplice, dipendenze gestite.

Funziona bene sul mio MBP Unibody, tutto a 64 bit.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top