1

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

enter image description here

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

enter image description here

Christophe
  • 68,716
  • 7
  • 72
  • 138
the_prole
  • 8,275
  • 16
  • 78
  • 163
  • There are a few possibilities, but start with ensuring the path to the bridging header is correct. Also, when working with Cocopods remember to work with (and open the project with) the Workspace. – BonanzaDriver Oct 20 '17 at 20:39
  • 1
    @BonanzaDriver Thanks, I just ended up added the relative folder path to the import and it worked! – the_prole Oct 20 '17 at 20:42
  • You might be able to even skip adding the folder `MMLanScan` if you use the `User header search paths` in the target `Build Settings` tab. – Adi Oct 20 '17 at 20:47

1 Answers1

0

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
the_prole
  • 8,275
  • 16
  • 78
  • 163