Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/142.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 不是libcurl的东西_C++_Visual C++_Libcurl - Fatal编程技术网

C++ 不是libcurl的东西

C++ 不是libcurl的东西,c++,visual-c++,libcurl,C++,Visual C++,Libcurl,所以我一直在尝试下载HTML文件或HTTP POST请求,但我总是遇到4个错误,比如 1>MyProgram.obj : error LNK2001: unresolved external symbol __imp__curl_easy_init 1>MyProgram.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt 1>MyProgram.obj : error LNK2001:

所以我一直在尝试下载HTML文件或HTTP POST请求,但我总是遇到4个错误,比如

1>MyProgram.obj : error LNK2001: unresolved external symbol __imp__curl_easy_init
1>MyProgram.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt
1>MyProgram.obj : error LNK2001: unresolved external symbol __imp__curl_easy_perform
1>MyProgram.obj : error LNK2001: unresolved external symbol __imp__curl_easy_cleanup
有一次我真的让它编译,每当我运行它,我会得到几个DLL错误,即使我把正确的DLL和我的可执行文件一起移动到文件夹中,编译器会吐出更多关于PDB的错误?如果我没记错的话

我现在对libcurl的任何人都可以提出其他建议,最好是有详细的文档记录,因为我在这方面还很新

是的,我已经搜索了一些没有什么结果的东西。非常感谢

编辑:使用SFML让它工作起来,谢谢大家

我使用。这是一个多媒体库,主要用于游戏开发,但它碰巧有处理HTTP的工具。它非常易于使用,以下内容将下载此页面:

#include <iostream>
#include <SFML/Network.hpp>

int main()
{
    sf::Http Http("stackoverflow.com");    
    sf::Http::Request req("/questions/9892198/something-other-than-libcurl");    
    sf::Http::Response page = Http.SendRequest(req);

    std::cout << page.GetBody();
}
#包括
#包括
int main()
{
sf::Http(“stackoverflow.com”);
sf::Http::Request-req(“/questions/9892198/libcurl以外的东西”);
sf::Http::Response page=Http.SendRequest(req);

std::cout作为比较,这里是一个简单的Poco程序:

#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
#include <iostream>

using namespace Poco::Net;

int main () {
  HTTPClientSession session("stackoverflow.com");
  HTTPRequest request("GET", "/questions/9892198/something-other-than-libcurl");
  HTTPResponse response;

  session.sendRequest(request);
  std::cout << session.receiveResponse(response).rdbuf();
}
#包括
#包括
#包括
#包括
使用名称空间Poco::Net;
int main(){
HTTPClientSession会话(“stackoverflow.com”);
HTTPRequest请求(“GET”,“/questions/9892198/libcurl以外的内容”);
HTTPResponse响应;
会话。发送请求(请求);

std::你看不到吗?在我看来,这是最明显的选择。我只是记得在看一些LIB时看到它。我会看看我是否能让它工作。请更正问题标题中的“then”到“than”。更好?(填写字符配额)哇,和curl相比,这看起来真的很容易!我要先玩一下POCO,如果其他的都失败了,我可能会尝试一下,在它工作后,我运行了它,它崩溃了visualstudio哈哈