Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i include python.h in QMake

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.

like image 342
邱奕愷 Avatar asked Oct 17 '25 11:10

邱奕愷


1 Answers

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
like image 199
eyllanesc Avatar answered Oct 19 '25 00:10

eyllanesc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!