cURL / Mailing Lists / curl-users / Single Mail

curl-users

Trouble Linking... in MinGW

From: George Ray Loveless <10308308_at_uvlink.uvsc.edu>
Date: Thu, 10 May 2007 14:06:46 -0600 (MDT)

Hi all,

 I am somewhat of a new programmer and am having some trouble getting
curl to work for me, I'm trying to get the provided "simple.c" sample
code to execute.

Please first take a look at my errors, well I should probably include
my code too. there is is:

CODE:
#include <stdio.h>
#include <curl/curl.h>

int main(void)
{
  CURL *curl;
  CURLcode res;

  curl = curl_easy_init();
  if(curl)
  {
    curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
    res = curl_easy_perform(curl);

    /* always cleanup */
    curl_easy_cleanup(curl);
  }
  return 0;
}

ERRORS:

Linking...
C:\proj\libcurl\MyMinGW\curlMinGWprac\Debug\myCurlminGWprac.o(.text+0x2d
): In function `main':
C:\proj\libcurl\MyMinGW\curlMinGWprac\myCurlminGWprac.cpp:11: undefined
reference to `_imp__curl_easy_init'
C:\proj\libcurl\MyMinGW\curlMinGWprac\Debug\myCurlminGWprac.o(.text+0x53
):C:\proj\libcurl\MyMinGW\curlMinGWprac\myCurlminGWprac.cpp:14:
undefined reference to `_imp__curl_easy_setopt'
C:\proj\libcurl\MyMinGW\curlMinGWprac\Debug\myCurlminGWprac.o(.text+0x60
):C:\proj\libcurl\MyMinGW\curlMinGWprac\myCurlminGWprac.cpp:15:
undefined reference to `_imp__curl_easy_perform'
C:\proj\libcurl\MyMinGW\curlMinGWprac\Debug\myCurlminGWprac.o(.text+0x70
):C:\proj\libcurl\MyMinGW\curlMinGWprac\myCurlminGWprac.cpp:18:
undefined reference to `_imp__curl_easy_cleanup'

curlMinGWprac.exe - 4 error(s), 0 warning(s)

I have downloaded the curl-7-16-2.zip version. I beleive this was the
developer version, it had header files and a bunch of other stuff.

When I placed all the content of "Curl's" Include folder into "MinGW's"
include folder, just these errors were left. I'm trying to create a
win32 console app too if it helps. I've messed around it for a while
and can't seem to get to work. Thanks for any help -Ray.
Received on 2007-05-10