cURL / Mailing Lists / curl-library / Single Mail


Re: How to statically link libcurl in c++

From: Dan Fandrich <>
Date: Fri, 19 Aug 2011 00:01:29 -0700

On Thu, Aug 18, 2011 at 02:02:05AM -0700, Mushfiqul Hasan Tuhin wrote:
> I am quite new to libcurl. I have developed a program with libcurl which send
> data from users pc to a web server via post method. But the problem is it needs
> 5-6 dll files to work. But I need only exe file not dll files. I came to know
> that it needs to link statically with libcurl. But I dont know how to do that. 
> I have searched google , but it wasn't helpful to me.   If anybody help me , I
> will be really grateful to him.......

You don't say which platform you're using, but on POSIX systems, you can run
'curl-config --static-libs' to see which libraries an app needs to link
against in order to link libcurl statically. To link those other libraries
statically as well may require linking against even more dependent libraries.
You'll have to run the equivalent of 'XYZ-config --static-libs' or
'pkg-config XYZ --static --libs' (if it's even available) on each of
the libraries output by the first command in turn to find out their
dependencies (and repeat recursively until done).

curl-config isn't available on Windows, so you'll probably have to use
trial-and-error there instead.

>>> Dan
List admin:
Received on 2011-08-19