【问题标题】:how can i include python.h in QMake我如何在 QMake 中包含 python.h
【发布时间】:2017-10-22 21:08:28
【问题描述】:

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。

【问题讨论】:

    标签: python c++ python-2.7 qt qmake


    【解决方案1】:

    您必须使用以下格式:

    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
    
    猜你喜欢
    • 2021-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多