gpt4 book ai didi

python - 我如何在 QMake 中包含 python.h

转载 作者:搜寻专家 更新时间:2023-10-31 01:32:04 24 4
gpt4 key购买 nike

INCLUDEPATH = -L /usr/include/python2.7

LIBS += /usr/local/lib/python2.7

QMAKE_CXXFLAGS += /usr/local/lib/python2.7

error: cannot find /usr/local/lib/python2.7: File format not recognized

有问题。我已经安装了 python-all-dev。

最佳答案

您必须使用以下格式:

LIBS += -L {path of your library.so} -l{library}    
INCLUDEPATH += {path of your headers}
DEPENDPATH += {path of your headers}

在你的情况下:

LIBS += -L /usr/local/lib/python2.7 -lpython2.7

INCLUDEPATH += /usr/include/python2.7
DEPENDPATH += /usr/include/python2.7

关于python - 我如何在 QMake 中包含 python.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44125902/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com