use of cURL library



我想编写适用于iPhone和Android的通用代码。为此,我想使用适用于 android 的 cURL 库,但对于 iOS,它给了我以下错误:

(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的一些链接错误。我无法找到正确的解决方案。请帮忙。

您是否将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中添加库的路径

最新更新