Undefined reference - despite lib being found by linker

后端 未结 4 2012
我在风中等你
我在风中等你 2020-12-28 20:32

I have a trivial program to test for availability of python development files:

#include
int main(){Py_Initialize(); Py_Finalize(); }
<         


        
4条回答
  •  醉话见心
    2020-12-28 20:50

    I encountered the same linking problem as well. But in my case it was not enough to provide -lpython. Also -L was needed. I.e.

    g++ -I/usr/include/python3.5 hw.cpp -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5
    

    And yes. Order matters.

提交回复
热议问题