Copying a dynamic library (.dylib) to a framework (.framework)

I have two Xcode projects: structure and client application. My application depends on my framework, and everything works fine with this - the infrastructure is recompiled every time the application is there, the paths for creating projects are correctly configured, everything is in order.

Now the structure started using a third-party dylib file, and it was associated with dylib. I even added a build phase to copy this library to the resource directory.

When I try to run the application, everything compiles correctly, then I get the following:

dyld: library not loaded: /usr/local/lib/libplplot.9.dylib Link: / Users / railsmaniac / Projects / Research / Calculus> approximations / Assembly / Debugging / XNMaths.framework / Versions / A / XNMaths Reason: image not found

How can i fix this? Adding a library to client application resources does not resolve the issue. I can just put the library in the right place, but I prefer to keep it within the framework. Is it possible?

+4
source share
1 answer

It looks like your application expects the library to be found on a specific path in the system. If you are on OS 10.5+, you can use the new @rpath functionality so that your application can dynamically link to your library.

See this post for more details. It also shows the "old" way to do this.

+3
source

All Articles