问题
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