cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using libcurl in win32 DLL in MVSC 2010

From: Bej Glee <bejglee_at_gmail.com>
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)
{
     return(convert("Test"));
}

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

But together does not work :-(
cURL properties in my MSVC++ project:
- Configuration properties->VC++ directories->Include Directories:
"C:\cURL\include\curl"
- Configuration properties->VC++ directories->Library Directories:
"C:\cURL\lib\Release"
- Configuration properties->Linker->Input->Additional Dependencies:
"C:\cURL\lib\Release\curllib.lib";kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib
- 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
Library"
- Configuration properties->C/C++->Preprocessor->Preprocessor Definitions:
"WIN32; NDEBUG; _WINDOWS; _AFXDLL; ETORO_EXPORTS"
- 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.

Bejglee

2012/7/23 Dan Fandrich <dan_at_coneharvesters.com>

> 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: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-24