鍍金池/ 問(wèn)答/Python  C  iOS/ python ios support編譯ios版,報(bào)錯(cuò)

python ios support編譯ios版,報(bào)錯(cuò)

error: 'clock_settime' is unavailable: not
      available on iOS
    ret = clock_settime((clockid_t)clk_id, &tp);
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/time.h:186:5: note: 
      'clock_settime' has been explicitly marked unavailable here
int clock_settime(clockid_t __clock_id, const struct timespec *__tp);
    ^
1 error generated.
make[1]: *** [Modules/timemodule.o] Error 1
make: *** [build/iOS/Python-3.4.2-iphonesimulator.x86_64/dist/lib/libpython3.4.a] Error 2
回答
編輯回答
野橘

這個(gè)錯(cuò)誤提示很明顯 .
就是 你選擇的版本的 iOS 下沒(méi)有這個(gè)系統(tǒng)函數(shù) clock_settime
事實(shí)上. macOS 也是 10.12 下才有這個(gè)函數(shù)的.

clock_settime 的手冊(cè)頁(yè)說(shuō)明如下.

These functions first appeared in Mac OSX 10.12

建議你找找你別人修改過(guò)可以在 iOS 下運(yùn)行的 python 版本, 或者自行修改.

2018年6月17日 10:47