how can i include python.h in QMake

旧街凉风 提交于 2021-02-05 06:12:05

问题


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

There is a problem. I have already installed python-all-dev.


回答1:


You must use the following format:

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

In your case:

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

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


来源:https://stackoverflow.com/questions/44125902/how-can-i-include-python-h-in-qmake

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!