Python.h header file missing on Mac OS X 10.6

后端 未结 4 820
-上瘾入骨i
-上瘾入骨i 2020-12-05 21:04

I\'m trying to access a shared C library in Python with ctypes on Mac OS X 10.6.8 with Python 2.7.4. To do this, I need to #include

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 21:41

    Python is a framework on Mac OS X so you need to,

    #include 
    

    You also need to call gcc with the -framework argument to actually do anything inside C,

    gcc -shared -o sample.so sample.c -framework Python
    

提交回复
热议问题