【发布时间】:2019-01-04 13:06:56
【问题描述】:
我使用 Curl 库(Cpp 编程)创建了 http POST 请求。
配置:
Visual studio 2017
Platform Toolset : Visual Studio 2015 - Windows XP (v140_xp)
当我在 windows xp 系统上运行 exe 时,它会抛出以下异常:
the procedure entry point gettickcount64 could not be located kernel32.dll
我的代码:
#include <curl/curl.h>
int main()
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "xxxxxx");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\n\t\"UserName\":\"abc\", \n\t\"Password\":\"xyz\"\n}");
CURLcode ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
return 0;
}
那么,如何解决这个错误?请帮忙。提前致谢。
【问题讨论】:
-
您自己构建了
libcurl还是使用了预构建的? -
我用的是预建的。
标签: c++ c curl visual-c++ libcurl