Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error LNK2019 unresolved external symbol __imp_curl_easy_setopt #141

Open
ruudll opened this issue Feb 15, 2022 · 7 comments
Open

Error LNK2019 unresolved external symbol __imp_curl_easy_setopt #141

ruudll opened this issue Feb 15, 2022 · 7 comments

Comments

@ruudll
Copy link

ruudll commented Feb 15, 2022

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,

@sgallou
Copy link
Collaborator

sgallou commented Feb 21, 2022

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.

@PiotrKFtw
Copy link

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.

@sgallou
Copy link
Collaborator

sgallou commented Mar 13, 2022

Curlpp 0.7.3.1 is pretty old ! Can you try with the latest version ?

@PiotrKFtw
Copy link

I'm using the latest veresion from nuget.

@sgallou
Copy link
Collaborator

sgallou commented Mar 14, 2022

Seems that push versions to nuget repo is no more maintained...

@xCENTx
Copy link

xCENTx commented May 12, 2022

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"

image

@sgallou
Copy link
Collaborator

sgallou commented May 12, 2022

Can you try replacing Url by curlpp::options::Url, please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants