1

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 のリンク エラーを示しています。適切な解決策を見つけることができません。助けてください。

4

1 に答える 1

2

XCode でのアプリのコンパイルのリンク プロセスに libcurl.a を追加しましたか? これがGCCの場合、次のようなフラグを追加することになりますが、-lcurlXCodeについてはよくわかりません。

これを試してください:
XCode -> Click on your project -> Your Target -> Build Settings -> Linking -> other Linker flags- here add-lcurl
ライブラリへのパスを追加する必要があるかもしれませんBuild Settings -> Search paths -> Library Search Paths

于 2012-11-23T07:59:27.320 に答える