objective-c - Xcode里面尝试链接.a静态库,运行的时候提示dylib的错误,怎么解决呢?
ringa_lee
ringa_lee 2017-05-02 09:26:58
0
1
455

我做一个Mac OS X上的程序,打算用libev。

我的做法是:下载libev,然后:

# ./configure
# make

接着,我把.lib/libev.ainclude/ev.h这两个文件添加到我的xcode工程里面,可以看到xcode识别到了libev.a,如下图:

但是当我run的时候,却出现了以下错误:

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

这个……什么情况啊?我明明添加了一个.a文件,为什么提示找不到dylib呢?
我这么添加libev是不是不对?正常情况下,我需要如何添加libev.a静态库呢?

先提前谢谢各位回答我问题的大神~~

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!