雪豹系统下64位PyQt4

3

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

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类的私有成员引起的错误吗?有人在Snow Leopard上成功编译过PyQt4吗?
3个回答

2

1
谢谢。我已经通过MacPorts安装了它。 port install py26-pyqt4 - D R

2
在更新日志中,我看到 Phil(PyQt 的维护者)昨天发行了开发快照的修复程序,专门针对 Snow Leopard:修复内容如下:

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

你是否正在使用昨天的 PyQt 版本?
邮件列表上这个主题也特别有趣。
PyQt 编译问题似乎是由于 Snow Leopard 默认的 64 位编译和它附带的混合 64/32 位版本 Python 导致的。
如果问题继续存在,建议将您的问题提交到此邮件列表(以便得到修复 - 希望如此),并尝试(暂时)以 32 位方式重新构建 Qt、PyQt(以及可能的 Python)(使用 -m32 编译器标志),如果您需要立即解决问题。

是的,我从几个小时前下载了开发快照。 - D R

0

你可能想要使用来自homebrew项目的PyQt:简单的构建,管理依赖项。

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接