objective-c - When trying to link a static library in Xcode, a dylib error is prompted when running. How to solve it?
ringa_lee
ringa_lee 2017-05-02 09:26:58
0
1
515

I am making a program on Mac OS X and plan to use libev.

What I do is: download libev, then:

# ./configure
# make

Next, I added the two files .lib/libev.a and include/ev.h to my xcode project. You can see that xcode recognized libev.a, as shown below:

But when I ran, the following error occurred:

dyld: Library not loaded: /usr/local/lib/libev.4.dylib
  Referenced from: /Users/Falcon/Library/Developer/Xcode/DerivedData/BrahBrah-hibmvwhxifxymfacottfiecsflqn/Build/Products/Debug/BrahBrah.app/Contents/MacOS/ToyControl
  Reason: image not found

What's going on with this...? I obviously added an .a file, but why does it say dylib cannot be found?
Is it wrong for me to add libev like this? Under normal circumstances, how do I need to add the libev.a static library?

Thank you in advance for everyone who answered my questions~~

ringa_lee
ringa_lee

ringa_lee

reply all(1)
淡淡烟草味

Uh...I found the reason myself. It turned out to be very simple: I copied libev.a to the project folder and it was OK...
I feel like I should be able to add the search path of the library in xcode, so I don't have to copy... …

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template