3

我刚刚在 64 位的 Snow Leopard 上编译了 Qt4.6 的最新预览版,没有任何重大问题。

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

现在,我正在尝试使用 River Bank 网站上的最新快照对 PyQt4.6 做同样的事情。但是,编译器退出并出现以下问题:

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.

这是 PyQt4 尝试访问 Qt4 类的私有成员的错误吗?有人在雪豹上成功编译过 PyQt4 吗?

4

3 回答 3

2

在更新日志中,我看到 Phil(PyQt 的维护者)昨天在专门针对 Snow Leopard 的开发快照中发布了修复:

2009/09/14 12:12:49 phil 进一步修复了 64 位系统上的雪豹。添加了 QObject.pyqtConfigure()。

你在使用昨天构建的 PyQt 吗?

邮件列表上的这个线程也特别有趣。

PyQt 编译问题似乎是由 Snow Leopards 默认的 64 位编译和它附带的 64/32 位混合版本的 Python 引起的。

如果事情继续出错,我会将您的问题提交到这个邮件列表(以便他们可以得到修复 - 希望)并尝试(临时)以 32 位方式重建 Qt 和 PyQt(可能还有 python)(使用 -m32编译器标志)如果你现在需要它工作。

于 2009-09-15T20:35:29.897 回答
2

我刚刚让 PyQt 4.6.2 与 64 位 Python 2.6.1 一起工作。我在这里发布了说明:http: //mpastell.com/2009/11/24/pyqt-4-6-2-with-snow-leopard/

于 2009-11-24T07:52:37.550 回答
0

您可能想使用自制项目中的 PyQt:直接构建、托管依赖项。

在我的 MBP Unibody 上运行良好,都是 64 位的。

于 2010-03-01T19:49:46.163 回答