【发布时间】:2020-05-04 12:00:07
【问题描述】:
我正在尝试构建 PyQt 4,因为它被我需要运行的程序使用。
虽然使用单个命令 pip install PyQt5 安装 PyQt 5 很简单,但对于较旧的 PyQt 4 则无法做到这一点,人们建议从源代码构建它。
我已经按照PyQt4 Download 的建议安装了 SIP。
我还下载了 PyQt 4 并将其解压缩。现在,当我运行 python configure.py --verbose 时,我得到了
Stanislaw@home:PyQt4_gpl_mac-4.12.3 (master)*$ python configure.py --verbose
Determining the layout of your Qt installation...
/usr/local/bin/qmake -spec macx-g++ -o qtdirs.mk qtdirs.pro
make -f qtdirs.mk
g++ -c -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/local/etc/qt4/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt@4/4.8.7_6/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt@4/4.8.7_6/lib/QtCore.framework/Versions/4/Headers -I/usr/local/include -I. -F/usr/local/lib -o qtdirs.o qtdirs.cpp
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
...
/usr/local/lib/QtCore.framework/Headers/qglobal.h:68:10: fatal error: 'algorithm' file not found
#include <algorithm>
^~~~~~~~~~~
我对 Qt/qmake 没有任何经验,但我猜这个旧版本的 PyQt 没有配置自己正确使用 macOS 的基于 Clang 的 C++ 工具链。
我会继续挖掘,但我也想知道这个问题是否存在简单的解决方案。
【问题讨论】: