2012-11-23 48 views
1

我想编写适用于iPhone和Android的通用代码。为此,我想使用的Android做工精细卷曲库,但适用于iOS它给了我以下错误:使用cURL库

(null): "_curl_easy_cleanup", referenced from: 
(null): "_curl_easy_init", referenced from: 
(null): "_curl_easy_perform", referenced from: 
(null): "_curl_easy_setopt", referenced from: 
(null): "_curl_easy_strerror", referenced from: 
(null): Linker command failed with exit code 1 (use -v to see invocation) 

上面的错误指示libcurl.a一些链接错误。我无法找到合适的解决方案。请帮忙。

回答

2

您是否已将libcurl.a添加到您在XCode中的应用程序编译的链接过程中?如果这是GCC,它将通过添加一个像-lcurl这样的标志,但我不太确定XCode。

试试这个:
XCode -> Click on your project -> Your Target -> Build Settings -> Linking -> other Linker flags - 在这里添加-lcurl
到库的路径可能需要在Build Settings -> Search paths -> Library Search Paths

+0

您好以复加,我在上面,但仍试图有同样的问题。 –

+0

如果库正确编译/下载,安装在正确的位置,包含在Xcode中的路径和添加的链接选项,那么我就不会有想法了,对不起 –

+0

你能解释一下吗从头开始? (一步一步的),并提供我链接下载库。 –