Reputation: 21
I previously asked a question concerning libcurl. I've managed to find an answer to it on my own, and will be glad to share how I solved the issue, as soon as I'm sure it worked. Here's the thing, previous to this, the linker would throw a fit when I tried to compile, and with a bit of searching and trial and error, I found that including this:
-I curl\include
-L curl\lib
-lws2_32
-lwldap32
into the linker made sure that the program compiled. The issue is, that once the program compiles, running it returns the error: The program can't start because libcurl.dll is missing from your computer. Try reinstalling the program to fix this problem.
Here's my code, though I doubt its relevant:
#define CURL_STATICLIB
#include "curl/curl.h"
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURLcode ret;
CURL *curl = curl_easy_init();
if (curl == NULL) {
fprintf(stderr, "Failed creating CURL easy handle!\n");
exit(EXIT_FAILURE);
}
/*Attempt to get Facebook*/
ret = curl_easy_setopt(curl, CURLOPT_URL, "http://www.facebook.com");
if (ret != CURLE_OK) {
fprintf(stderr, "Failed getting http://www.google.com: %s\n",
curl_easy_strerror(ret));
exit(EXIT_FAILURE);
}
ret = curl_easy_perform(curl);
if (ret != 0) {
fprintf(stderr, "Failed getting http://www.google.com: %s\n",
curl_easy_strerror(ret));
exit(EXIT_FAILURE);
}
return 0;
}
Any help would be appreciated.
Upvotes: 0
Views: 517
Reputation: 1025
You have succesfully linked the compiler to the static library of libcurl
. However when you execute the program It tries to find the .ddl
for libcurl
and is unable to find it at the directories it searches. Usually this is the directory you run the application from. Try putting the .dll
at that location and see if that helps.
Upvotes: 2