昨天在运行cocos的test项目时碰到了这种情况,错误代码:

"_curl_easy_cleanup", referenced from:
CurlTest::ccTouchesEnded(cocos2d::CCSet*, cocos2d::CCEvent*) in CurlTest.o
cocos2d::extension::CURLRaii::~CURLRaii() in HttpClient.o
"_curl_easy_getinfo", referenced from:
cocos2d::extension::CURLRaii::perform(int*) in HttpClient.o
"_curl_easy_init", referenced from:
CurlTest::ccTouchesEnded(cocos2d::CCSet*, cocos2d::CCEvent*) in CurlTest.o
cocos2d::extension::CURLRaii::CURLRaii() in HttpClient.o
"_curl_easy_perform", referenced from:
CurlTest::ccTouchesEnded(cocos2d::CCSet*, cocos2d::CCEvent*) in CurlTest.o
cocos2d::extension::CURLRaii::perform(int*) in HttpClient.o
"_curl_easy_setopt", referenced from:
CurlTest::ccTouchesEnded(cocos2d::CCSet*, cocos2d::CCEvent*) in CurlTest.o
cocos2d::extension::configureCURL(void*) in HttpClient.o
bool cocos2d::extension::CURLRaii::setOption<char const*>(CURLoption, char const*) in HttpClient.o
bool cocos2d::extension::CURLRaii::setOption<bool>(CURLoption, bool) in HttpClient.o
bool cocos2d::extension::CURLRaii::setOption<curl_slist*>(CURLoption, curl_slist*) in HttpClient.o
bool cocos2d::extension::CURLRaii::setOption<unsigned long (*)(void*, unsigned long, unsigned long, void*)>(CURLoption, unsigned long (*)(void*, unsigned long, unsigned long, void*)) in HttpClient.o
bool cocos2d::extension::CURLRaii::setOption<void*>(CURLoption, void*) in HttpClient.o
"_curl_slist_append", referenced from:
cocos2d::extension::CURLRaii::init(cocos2d::extension::CCHttpRequest*, unsigned long (*)(void*, unsigned long, unsigned long, void*), void*, unsigned long (*)(void*, unsigned long, unsigned long, void*), void*) in HttpClient.o
"_curl_slist_free_all", referenced from:
cocos2d::extension::CURLRaii::~CURLRaii() in HttpClient.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)


然后发现是一个libcurl.a这个没有导入工程,导入即可

文件路径:

cocos2dx>>platform>>third_party>>ios>>libraries>>libcurl.a

因为我运行的是ios版本,所以选的是ios版本,其他的应该类似,我没有试验过

然后导入成功后即可运行成功

屏幕快照 2015-03-11 上午9.51.12.png



☟☟可点击下方广告支持一下☟☟

最后修改:1970 年 01 月 01 日
请我喝杯可乐,请随意打赏: ☞已打赏列表