我想编译一个swift程序,它使用在运行Linux(Ubuntu 16.0.4)的虚拟机上用Objective-C编写的代码,Swift 4.0.3)。Linux上的Swift Objective-C互操作性错误:找不到'Foundation/Foundation.h'文件
我编译时出现此错误:
fatal error: 'Foundation/Foundation.h' file not found
#import <Foundation/Foundation.h>
^
1 error generated.
在Mac OS
相同的程序完美的作品在Mac OS。
我试过了什么?
我试过恢复到迅速3.1.1(我记得这个工作在快速3前一阵子)。
我已经广泛地搜索了这个问题,但没有成功。
我已经按照有关如何安装Linux上的Objective-C运行指令和安装GNUstep的(见http://www.techotopia.com/index.php/Installing_and_Using_GNUstep_and_Objective-C_on_Linux)
所有没有成功。
为什么我使用objective-C?
(预测此问题)。
我需要从程序中调用python脚本。 Python有一个C库,我只能用C或Objective-C。
事实上,注释掉行#import <Foundation/Foundation.h>
导入Python库时发出编译失败:在Linux上
fatal error: 'Python/Python.h' file not found
#include <Python/Python.h>
^
1 error generated.
看起来您的基金会和Python框架的副本不在系统标题路径中。 –
@JoshCaswell,谢谢。我怎样才能验证这一点? – kmn