Error LNK2019 unresolved external symbol __imp_curl_easy_setopt
ruudll opened this issue · 7 comments
I'm trying to use your Curlpp wrapper around libcurl and it looks very promising. I installed version 0.7.3.1 via Nuget in VS2019 and after adding below, it compiled fine.
#define CURLPP_STATICLIB
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
Now I'm trying to implement code from your example, but as soon as I use for example the code below it gives me an Unresolved External Symbol.
curlpp::options::Url url(std::string(this->url));
Error LNK2019 unresolved external symbol __imp_curl_easy_setopt referenced in function "public: void __cdecl curlpp::internal::CurlHandle::option<void *>(enum CURLoption,void *)"
Do you maybe have any clue how to solve this?
Thanks in advance,
Hi,
Curlpp can not find curl library. Check that libcurl.lib (or libcurl-d.lib for debug) exists in your app project settings (linker ==> inputs ==> additional dependencies). Check also the path to theses files.
Same error here. I've added libcurl.lib to additional dependencies, also tried other solutions like
#pragma comment(lib, "libcurl.lib")
Tried copy pasting libcurl.lib from static folder to another location and include that with no luck.
Also c++ 17 completely breaks your library.
Curlpp 0.7.3.1 is pretty old ! Can you try with the latest version ?
I'm using the latest veresion from nuget.
Seems that push versions to nuget repo is no more maintained...
Maybe they should be maintained? Building this project for C++ is kind of a pain in the rear. Nobody wants to install 15 other programs to make a simple http request
Its pretty sad that you can't even complete the first example with the nuget package version of curllpp
myRequest.setOpt<Url>("http://example.com");
the error being "Url"
Can you try replacing Url
by curlpp::options::Url
, please ?