在桥接头中找不到头文件 [英] Header file not found in Bridging Header
问题描述
我看过一些电话,找不到解决该问题的方法。
我安装了
但是在构建应用程序时,我遇到了两个编译时错误
错误1:
MMLANScanner.h $ c找不到$ c>文件
错误2:
无法发出预编译的头文件`/ Users /我的用户名/ Library / Devel oper / Xcode /派生数据/我的项目名称...
当我从桥接头文件中删除导入文件时,这些错误都会消失
任何了解如何编译该库的线索都将受到赞赏。
编辑
所以所需的.h文件似乎在我的pod目录中,所以不确定为什么会出现这些错误
因此,解决方案就像添加相对文件夹一样简单头文件导入的路径
#ifndef BridingHeader_h
#define BridingHeader_h
#import MMLanScan / MMLANScanner.h
#import MMLanScan / LANProperties.h
#import MMLanScan / PingOperation.h
#import MMLanScan / MMLANScanner.h
#import MMLanScan / MACOperation.h
#import MMLanScan / MacFinder.h
#import MMLanScan / MMDevice.h
#endif
不是
#ifndef BridingHeader_h
#define BridingHeader_h
#import MMLANScanner.h
#import LANProperties.h
#import PingOperation.h
#import MMLANScanner.h
#import MACOperation.h
#import MacFinder.h
#import MMDevice.h
#endif
I've looked through a number posts and cannot find a solution to this problem.
I installed the MMLanScan Objective C library into in my pod file successfully.
Then I created a bridging header file in my project directory
#ifndef BridingHeader_h
#define BridingHeader_h
#import "MMLANScanner.h"
#import "LANProperties.h"
#import "PingOperation.h"
#import "MMLANScanner.h"
#import "MACOperation.h"
#import "MacFinder.h"
#import "MMDevice.h"
#endif
I also set the header file path in my project's compiler settings
But when I build my app, I get two compile time errors
error 1:
MMLANScanner.h
file not found
error 2:
Failed to emit precompiled header `/Users/my user name/Library/Developer/Xcode/Derived Data/My Project Name...
Both these errors disappear when I delete my imports from the bridging header file.
Any clues how to compile this library would be appreciated.
edit
So the required .h files appear to be in my pod directory, so not sure why I get these errors
So the solution was as simple as adding the relative folder path to the header file imports
#ifndef BridingHeader_h
#define BridingHeader_h
#import "MMLanScan/MMLANScanner.h"
#import "MMLanScan/LANProperties.h"
#import "MMLanScan/PingOperation.h"
#import "MMLanScan/MMLANScanner.h"
#import "MMLanScan/MACOperation.h"
#import "MMLanScan/MacFinder.h"
#import "MMLanScan/MMDevice.h"
#endif
not
#ifndef BridingHeader_h
#define BridingHeader_h
#import "MMLANScanner.h"
#import "LANProperties.h"
#import "PingOperation.h"
#import "MMLANScanner.h"
#import "MACOperation.h"
#import "MacFinder.h"
#import "MMDevice.h"
#endif
这篇关于在桥接头中找不到头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!