我正在尝试在我的iOS应用中使用this library。我得到了正确的编译,但是当我尝试运行以下内容时出现错误。
#import "pyconfig.h"
//...
- (void)viewDidLoad {
[super viewDidLoad];
Py_SetProgramName((char*)[[[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/"] UTF8String]);
Py_Initialize();
PyRun_SimpleString("print 'Hello world!'");
}
Error: Implicit declaration of function 'Py_SetProgramName' is invalid in C99
Warning: This function declaration is not a prototype
Error: Implicit declaration of function 'Py_Initialize' is invalid in C99
Warning: This function declaration is not a prototype
Error: Implicit declaration of function 'PyRun_SimpleString' is invalid in C99
Warning: This function declaration is not a prototype
我已关联libpython.a
并添加了pylib
。我正在使用Xcode 9.2