Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C++ LibCurl Problem. Linking. -- Sorry about wrong section.

I included libcurl in my .cpp file, but I get a error that I can't fix.

It's a linking error I think.

My code :

Code
#include<libcurl/curl/curl.h>

int main()
{
    CURL *curl = curl_easy_init();
    if (curl)
    {
        curl_easy_setopt(curl, CURLOPT_URL, "SITE");
        curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }
    return 0;
}


Error :

Code
unresolved external symbol _imp_curl_easy_init referenced in function main.


Can someone tell me why...

I'm 99% sure it' because I'm not using a .lib file, however the .zip did not include any .lib or even a dll. I had to download the .dll from somewhere else.


It would help greatly if someone could provide me the .lib file for LibCurl...
You are right about the issue. You can fix some versions by linking all the libraries properly. If you've got the static version, you should try to define CURL_STATICLIB in your project. Note that I haven't used cURL in the last 1 year so it's not for sure going to work.
(Oct 7, 2017 12:23 PM)sLiCkToR Wrote:  You are right about the issue. You can fix some versions by linking all the libraries properly. If you've got the static version, you should try to define CURL_STATICLIB in your project. Note that I haven't used cURL in the last 1 year so it's not for sure going to work.

Thank you so much, after a few PreCompiled errors, I managed to realize that I couldn't include LibCurl until after I defined CURL_STATICLIB.

I managed to get it working :D.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by redoMar 28, 2026 10:35 AM 0 71 Mar 28, 2026 10:35 AM
Last Post: redo
[Help] by craigOwnsYouOct 9, 2019 08:53 AM 5 272 Oct 9, 2019 08:53 AM
Last Post: Deal
[Help] by MiarJun 8, 2017 06:16 AM 0 84 Jun 8, 2017 06:16 AM
Last Post: Miar