cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl compiles w/ MinGW but doesn't work

From: Damien Pierce <emaildmp_at_yahoo.com>
Date: Sun, 12 Mar 2006 07:14:01 -0800 (PST)

I am using MinGW on WinXP.

I can compile libcurl fine, and I can compile simple.c
and link to libcurldll.a or libcurl.dll, but when the
program runs it just crashes. If I link to libcurl.a I
get the common error "undefined reference to
`_imp__curl_easy_init'". I don't really understand
static vs. dynamic linking, but I deleted *.o and
recompiled everything with -DCURL_STATICLIB thinking
that would help. But everything is the same in that
case.

I compiled curl.exe fine and it runs fine. I don't
understand why simple.c linked to libcurl crashes. Any
ideas? Thanks.

/*************** simple.c ************/
/****** this compiles but crashes *********/
#include <stdio.h>
#include <curl/curl.h>

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

  printf("wha?!\n");
  curl = curl_easy_init();
  /*
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_URL,
"curl.haxx.se");
    res = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
  */
  return 0;
}
Received on 2006-03-12