1

I'm trying to import this library (SCRecorder) into my Swift project using the "Bridging Header File" method. But I really can't make it work. When I try to build the project, I get the following error :

error: 'SCRecorder/SCRecorder.h' file not found 
#import <SCRecorder/SCRecorder.h>

Here is the content of my bridging header file :

#ifndef Project_Bridging_Header_h
#define Project_Bridging_Header_h

#import <SCRecorder/SCRecorder.h>

#endif

And here is my project structure :

enter image description here

Of course I have added the reference to the Bridging Header File in my Build Settings. I'm almost sure it's just a path issue... But after some hours spent on this, I really can't find a solution.

Thanks.

EDIT : Instead of importing the project directly, I have added it with the CocoaPods method, and I get a new error :

library not found for -lSCRecorder
Christophe
  • 68,716
  • 7
  • 72
  • 138
fraxool
  • 3,199
  • 4
  • 31
  • 57

3 Answers3

1

OK. I figured it out. I just didn't use the *.xcworkspace project after installing pods... After opening my project with this file, everything works well, as expected.

Thanks for your help, especially @kaizoku for suggesting me to use this file.

fraxool
  • 3,199
  • 4
  • 31
  • 57
0

You should try to install the library using 'cocoapods'
There could be something wrong while importing the project manually.

Here is a tutorial on how to install Cocospods and initialise your podfile in your application.

Then you can add pod 'SCRecorder' in the Podfile and go back to the terminal and type pod install.
This will install all the dependent libraries for SCRecorder.

Finally, go and try running the build. It should work.
Safe side, keep a backup of this build. Good Luck :)

votelessbubble
  • 788
  • 6
  • 19
  • Thanks for your suggestion. I have done that now, but I get a new error : "library not found for -lPods". – fraxool Jan 04 '16 at 17:32
  • 1
    You need to open yourproject.xcworkspace I hope thats what you're doing. The xcodeproj file will give you errors – votelessbubble Jan 05 '16 at 04:07
0

I had a similar issue with pods. Basically trying to run my UI tests, Xcode complained about missing pods. Solution to this was:

  1. go to project file (main not a target)
  2. click on the "Info" tab (most left)
  3. set proper pod configuration for UI tests target ("Configurations" section right under "Deployment Target")

Working!

A bit more about this: https://github.com/CocoaPods/CocoaPods/issues/2695

Julian
  • 9,299
  • 5
  • 48
  • 65