I'm trying to get the content from http pages in a string the way it is adviced here. I downloaded the curlpp zip and added the include folders to my project using INCLUDEPATH += "<path>"
in the .pro file and of course included them in the header of my project. After that, Qt Creator found the files (before using INCLUDEPATH, I got the error that the file's not found) but I assume I did something wrong when including them, because now, I get several "undefined reference to" errors like i.e.: "error: undefined reference to curlpp::Cleanup::Cleanup()'" or "error: undefined reference to curlpp::OptionBase::OptionBase(CURLoption)'".
Any idea what I could have done wrong?
Asked
Active
Viewed 126 times
0

Schulp
- 73
- 6
-
Looks like you didn't add the library file to the linker options. – user4581301 Mar 11 '20 at 15:44
-
It seems that curlpp doesn't have any .lib file that i could add to the linker. At least I can't find one – Schulp Mar 11 '20 at 16:32
-
cURLpp is not a header-only library. It needs to be configured and built unless you have a canned library built for your development environment (and it sounds like you don't). Did you follow all of the set-up instructions at the beginning of [the manual](https://github.com/jpbarrette/curlpp/blob/master/doc/guide.pdf)? – user4581301 Mar 11 '20 at 17:11
-
I've tried to follow the steps but when it came to compiling and linking the programm, I couldn't quite follow the manual anymore since I am using Windows but there's only Unix explained... – Schulp Mar 11 '20 at 19:32
-
[Over at this question](https://stackoverflow.com/questions/55583817/how-do-i-use-curlpp-with-visual-studio), drescherjm suggests https://github.com/Microsoft/vcpkg and then the trail goes dead. Maybe it worked. Maybe it didn't. – user4581301 Mar 11 '20 at 19:45
-
Thank you for the suggestion but for me it doesn't work. Is there any other way in C++ to save the contents of a website in a string without using curl/curlpp? – Schulp Mar 12 '20 at 10:30
-
Many of them in varying orders of complexity. I never bothered with cURLpp and just directly used cURL. I am not overly familiar, but there is certainly something you can use in .Net. Any large networking framework will have *something*. You can also take a look at [Boost Beast](https://www.boost.org/doc/libs/1_72_0/libs/beast/doc/html/index.html). Boost is a Swiss Army Knife with a tool for just about everything, so it is massive overkill for any one job--swatting a fly with a bazooka--but once you have it set up, it is low maintenance and you keep using it for other jobs. – user4581301 Mar 12 '20 at 15:23
-
You probably won't even need to set it up.Sourceforge used to have a collection of pre-built libraries for MSVC ([and it looks like it still does](https://sourceforge.net/projects/boost/files/boost-binaries/)) – user4581301 Mar 12 '20 at 15:25