How to link .dylib file to Xcode?

Viewed 538

I am trying to do the Gstreamer tutorials on Xcode and when I try to build my tutorial one file, its fails. I get an error saying: file not found: @rpath/lib/libgstnet-1.0.0.dylib for architecture x86_64. To my understanding, you have to link your dynamically loaded libraries at runtime. I thought I did this by add the framework in which the .dylib file is included in as shown below: enter image description here

However, I still get the same error. Furthermore, I tried even simply adding the .dylib into my project folder using finder and seeing if I can add the file from there, but the .dlib file I added wasn't even an option. How do I fix this problem?

1 Answers

I had the same problem and it seems to be an issue with Apple's recently increased requirements for "code signing". The current gstreamer packages appear to be unsigned ("unknown developer"), so XCode refuses to load them (but won't tell you exactly what is happening either).

One workaround is to go into the "Signing&Capabilities" tab of your compilation target and make sure "Disable Library Validaton" is checked (this worked for me).

If you feel more kamikaze-like you can also sign all the libraries with your own developer identification using the "codesign" terminal command. This thread deals with a similar problem: https://github.com/opencv/opencv/issues/15645

Related