【问题标题】:PyQt4 on Snow Leopard in 64 bit64 位雪豹上的 PyQt4
【发布时间】:2009-09-15 19:41:39
【问题描述】:

我刚刚在 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 类的私有成员的错误吗?有人在 Snow Leopard 上成功编译过 PyQt4 吗?

【问题讨论】:

    标签: qt4 osx-snow-leopard pyqt4 x86-64


    【解决方案1】:

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

    【讨论】:

    • 谢谢。我已经通过 macports 安装了它。 port install py26-pyqt4
    【解决方案2】:

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

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

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

    This thread on the mailinglist 也特别有趣。

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

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

    【讨论】:

    • 是的,我在几个小时前下载了开发快照。
    【解决方案3】:

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

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

    【讨论】:

      猜你喜欢
      • 2011-07-08
      • 2012-12-10
      • 2011-03-05
      • 1970-01-01
      • 2012-01-10
      • 2012-03-14
      • 2010-11-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多