Reputation: 21
I'm using this code in DEV C++ environment.
#include <stdio.h>
#include <curl/curl.h>
#include <iostream>
using namespace std;
int main(void){
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "TestAgent");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
system("pause");
return 0;
}
I have linked libcurldll.a and libcurl.a files. I can compile and run the code but the executable required msvcr70.dll and libcurl.dll in the same directory. How can I link them statically?
Upvotes: 2
Views: 1679
Reputation: 1
Have a look at the curl-config
tool. It provides an option to get the linker flags and dependencies to build libcurl for static linking:
--static-libs
Shows the complete set of libs and other linker options you will need in order to link your application with libcurl statically. (Added in 7.17.1)
In order for doing so, you need to build libcurl from source on your environment.
Upvotes: 1