Header file not found in Bridging Header

大城市里の小女人 提交于 2019-12-11 06:26:28

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/46856839/header-file-not-found-in-bridging-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!