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。
答案 0 :(得分:2)
您必须使用以下格式:
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