昨天在运行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版本,其他的应该类似,我没有试验过
然后导入成功后即可运行成功
版权属于:东哥笔记 - DongGe.org
本文链接:https://dongge.org/blog/74.html
自2017年12月26日起,『转载以及大段采集进行后续编辑』须注明本文标题和链接!否则禁止所有转载和采集行为!