我如何在 QMake 中包含 python.h [英] how can i include python.h in QMake
本文介绍了我如何在 QMake 中包含 python.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
INCLUDEPATH = -L/usr/include/python2.7
INCLUDEPATH = -L /usr/include/python2.7
LIBS +=/usr/local/lib/python2.7
LIBS += /usr/local/lib/python2.7
QMAKE_CXXFLAGS +=/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.
There is a problem. I have already installed 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
这篇关于我如何在 QMake 中包含 python.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文