0

I'm trying to make an application in C++, in Windows using VS 2015. I've read in many places that curlpp is a good way to make HTTP requests. So I downloaded curlpp and noticed that it needed libcurl.

I've built curlpp normally, and I've also managed to build libcurl using the instructions inside winbuild/BUILD.WINDOWS.txt and it generated a libcurl_a.lib. I've also added everything to the include paths, preprocessor, additional dependencies, whatnot.

However, when I try to compile my project, here's what I get:

1>curlpp.lib(cURLpp.obj) : error LNK2001: unresolved external symbol __imp__curl_version

I'm not sure how to fix this. I've searched the entire libcurl and curlpp trying to find what __imp__curl_version is with no luck. I've also spent a lot of time trying to figure it out, but everywhere I look, people just say that libcurl needs to be linked, but I'm already doing that. What is wrong?

If you need any more information, I'll update the post.

Thanks!

EDIT: As @frymode suggested, I used another sln file and compiled using another configuration. That solved my problem.

bokirov
  • 13
  • 1
  • 4
  • Possible duplicate of [cUrl: Undefined reference](http://stackoverflow.com/questions/34403511/curl-undefined-reference) – dewaffled Jan 24 '16 at 10:23
  • @frymode, I tried to do that. I defined the macro, but didn't make a difference. I'm passing both `CURLPP_STATICLIB` and `CURL_STATICLIB` to the preprocessor definitions. I'm also linking `libcurl_a.lib` and `curlpp.lib`. The only error I have is this `__imp__curl_version` thing. If I change anything, I get a lot of __imp__ errors, which is why I'm lost. – bokirov Jan 24 '16 at 16:30
  • Dunno if this helps, but... http://pastebin.com/bciyB2eW – bokirov Jan 24 '16 at 16:39
  • `__imp__` prefix means `cURLpp.obj` was built with dynamic library mangling and you are linking with static. [Sources](https://github.com/jpbarrette/curlpp/blob/master/win32/curlpp.examples.vcproj.stub) seem to have different configuartions, you maybe need `StaticLibReleaseStaticRTL` build if you want everything linked statically – dewaffled Jan 24 '16 at 19:20
  • I used [this one](https://github.com/jpbarrette/curlpp/blob/master/curlpp.VC8.sln) with ReleaseStatic instead to compile. Now I've used the one with StaticLibReleaseStaticRTL and it worked perfectly. Thank you! – bokirov Jan 24 '16 at 19:53

0 Answers0