0

I'm having trouble linking libCurl in my C++ project, and I hope someone can help me figure out what's going wrong. I'm getting the following linker error:

error LNK2019: unresolved external symbol __imp__curl_easy_strerror referenced in function _main

I had 5-6 more similar to this.

I'm not sure what's causing this error, but it seems related to the libCurl library. Here's what I've done so far:

  • I downloaded the latest version of libCurl from the official website and installed it on my machine.
  • I added the relevant include directories to my project's properties.
  • I added the libcurl.lib file to my linker input.

Despite these steps, I'm still getting the linker error mentioned above. I've searched online for solutions and tried a few things, but nothing seems to work. I'm using Visual Studio 2019 on Windows 10.

Could someone kindly explain why this error is happening and how I can resolve it? I'm relatively new to C++ and linking libraries, so any advice would be appreciated. Thank you!

P.S: I watched TroubleChutes guide on curl lib implementation of c++ and I even tried to install it via VCPKG but couldn't figure out how. Here are the videos I've used:

I have also tried explore some other topics similar to this on Stack Overflow, however, none of these have been helpful.

James Z
  • 12,209
  • 10
  • 24
  • 44
Silence
  • 45
  • 1
  • 6
  • 2
    Are you trying to link with a DLL or with a static library? My guess is that the compiler is looking for an import library (to link with a DLL) but you have provided a static library. – john Apr 01 '23 at 17:21
  • That might be it. cheers mate. – Silence Apr 01 '23 at 18:03
  • I tried use libcurl_a_debug.lib or something like that. – Silence Apr 02 '23 at 09:53
  • LNK2019 is usually an error caused by linking, if you are trying to link DLL, I suggest you refer to this [document](https://learn.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=msvc-170#create-a-client-app-that-uses-the-dll). – Yujian Yao - MSFT Apr 03 '23 at 02:04

0 Answers0