如何解决在 firefox.exe 中的 0x00007FFAF6BC72A6 (ntdll.dll) 处抛出 libcurl 静态异常:0xC0000005:访问冲突写入位置 0x0000000000000024
我正在尝试通过 libcurl 静态构建执行 curl 请求。但是在调试模式下,只要指针移动到 curl = curl_easy_init();函数它开始抛出异常访问冲突写入位置错误发生。我正在使用 vs 2019,以下是抛出错误的代码段。
#define CURL_STATICLIB
#pragma comment ( lib,"wldap32.lib" )
#pragma comment (lib,"crypt32")
#pragma comment(lib,"libcurl_a_debug3.lib")
#include "HTTP.h"
#include "curl/curl.h"
BOOL HttpSubmitRequest(HttpRequestData &httpRequestData)
{
CURL* curl;
CURLcode res;
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl,CURLOPT_URL,"https://idiscountscode.com");
/* example.com is redirected,so we tell libcurl to follow redirection */
curl_easy_setopt(curl,CURLOPT_FOLLOWLOCATION,1L);
/* Perform the request,res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if (res != CURLE_OK)
fprintf(stderr,"curl_easy_perform() failed: %s\n",curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。