ld.lld: error: undefined symbol: http_client_send_async(http_client_s*, std::__1::shared_ptr<HttpRequest>, std::__1::function<void (std::__1::shared_ptr<HttpResponse> const&)>)
l123456789jy opened this issue · comments
http_client_send_async方法 ,undefined symbol: 只有这个异步方法找不到
static void processResponse(HttpResponsePtr resp) {
if (resp != nullptr) {
printf("%d %s\n", resp->status_code, resp->status_message());
printf("%s\n", resp->body.c_str());
} else {
printf("Request failed\n");
}
}
static void test_http_async_client(HttpClient* cli) {
// 创建 HttpRequest 对象
auto req = std::make_shared();
req->method = HTTP_GET;
req->url = "https://suggest.taobao.com/sug?code=utf-8&q=%E5%A5%B6%E7%93%B6&callback=cb";
// 异步发送请求
cli->sendAsync(req, processResponse);
}
编译构建问题推荐到QQ群里求助吧
ndk stl 问题已经解决