Jump to content

cURL in C++


Recommended Posts

Hi all,

I'm trying to work with the curl library to make an HTTP request in C++; however, I keep getting the error "undefined reference to `__imp__curl_easy_init'"

 

This is my code thus far:

#include <string>
#include <iostream>
#include <fstream>
#include <windows.h>
#include <curl/curl.h>

using namespace std;

int main()
{
    //some other stuff that I'm doing...not really important; works fine.

    CURL* curl = curl_easy_init(); //this line giving the error
}

I don't know if anyone else here uses the curl library...some help would be awesome. Google yields no answers that I can find; either that or I'm just unworthy.

 

I've also tried following the curl documentation here but fail to understand...kind of embarrassing :P

 

So yeah, thanks in advance :)

Link to comment
https://forums.phpfreaks.com/topic/161211-curl-in-c/
Share on other sites

I think it's something to do with my curl files. I just copied the includes to my includes dir for codeblocks, but I think that's where the error is.

 

Does anyone know how to install/compile/copy the right files or whatever?

 

This is the most irritating thing in the world...I've been searching for hours...

Link to comment
https://forums.phpfreaks.com/topic/161211-curl-in-c/#findComment-850731
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.