cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem using curl in a Apache module

From: Juanjo C <jjcuadrado_at_gmail.com>
Date: Wed, 27 Mar 2013 10:53:09 +0100

Hi,

I'm trying to do a Apache module in C and in this module I'm using curl.
With APXS, I can to deploy the module into Apache, but when I try to
restart Apache, it shows me this error. "undefined symbol:
curl_easy_perform. Action 'configtest' failed."

The module is trivial... only a example of how to made a connection via
HTTP from a Apache module to a URL.

        CURL *curl;
CURLcode res;

curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "
http://localhost:9080/P23Protector/protector");

/* example.com is redirected, so we tell libcurl to follow redirection */
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);

/* Check for errors */
if(res != CURLE_OK) {
ap_rprintf(r, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
} else {
ap_rputs("<br/>OOOOOOOOOKKKKKKKKKKKKK.", r);
}

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

The module works fine when I don't put anything about curl, but when I
include the code that does reference to curl, the Apache server don't
restart and it shows the error.

Thanks.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-27