cURL / Mailing Lists / curl-library / Single Mail


Re: Using libcurl in win32 DLL in MVSC 2010

From: Bej Glee <>
Date: Tue, 24 Jul 2012 09:51:09 +0200

OK, you're right! The situation is:
1. The DLL is working without curl section. The "Test" text arrived in
the calling
(external) program.

MY_EXPFUNC char* __stdcall getHTML(void)

2. The cUrl function is working when I create separate windows console

But together does not work :-(
cURL properties in my MSVC++ project:
- Configuration properties->VC++ directories->Include Directories:
- Configuration properties->VC++ directories->Library Directories:
- Configuration properties->Linker->Input->Additional Dependencies:
- These are copied into the my project directory: curllib.dll,
libeay32.dll, openldap.dll, ssleay32.dll, libsasl.dll.

DLL properties in my MSVC++ project:
- Configuration properties->General->Use of MFC: "Use MFC in a Static
- Configuration properties->C/C++->Preprocessor->Preprocessor Definitions:
- Configuration properties->C/C++->Code Generation->Runtime Library:
"Multi-threaded DLL (/MD)"

I hope everything I wrote...
I think, after build the DLL size is too small.
It seems that compiler don't put dependencies into DLL release.


2012/7/23 Dan Fandrich <>

> On Mon, Jul 23, 2012 at 11:00:48AM +0200, Bej Glee wrote:
> > I want to create a win32 DLL what use libcurl. My goal is: read a HTML
> page and
> > get back as string.
> > An external program (not C++) call this DLL, and get the HTML page in
> string.
> > I want to create ONE dll which contains the necessary resources (all
> dll).
> Then you'll have to statically link libcurl and all its dependencies
> into your single DLL.
> > The project build successful -> dll has been created, but when I call
> getHTML()
> > function I get error: "cannot load library 'example.dll' (error 126)".
> > Someone can tell you what to set in the project?
> You didn't provide any information as to how you linked your DLL, so we
> can't tell what went wrong. Chances are, it's depending on another DLL
> (such as libcurl.dll) which isn't available. There are dependency
> walking tools available for Windows that should show you what
> dependencies are missing.
> >>> Dan
> -------------------------------------------------------------------
> List admin:
> Etiquette:

List admin:
Received on 2012-07-24