cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: vc++ still having problems

From: JB <curl_at_itpsg.com>
Date: Thu, 1 Sep 2005 23:24:19 -0600

Again, thanks for taking the time to reply. I would really like to make a
success story out of this.

>
> > Out of the box, the curl.exe does not even compile clean. nmake with
any of
> > the targets that link curl.exe always fail with at least four unresolved
> > symbols starting with __imp__. The snapshot yeilds same results as
released
> > version. I think that is great that there lots of windows users out
there
> > using this but I am guessing the vast majority is using the dll.
However, I
> > need the static lib and having a hell of a time getting it to work. If
it's
> > on my end, ok, but someone somewhere must have an idea of what I am
doing
> > wrong? I have even followed several documents and articles I've found
on
> > the net also with no luck.
>
> Try build libcurl with the following command-line:
>
> nmake -f Makefile.vc6 CFG=debug-ssl
>

Already done it.

> Create new console project in VC, copy code of your program to the
> source file of this project.
>

yep, did that.

> Set C/C++->Code Generation->Runtime Library option to "Multi-Threaded
Debug
> DLL" (/MDd), to make it the same to RTL with which libcurl was
> compiled (see CCDEBUG in makefile.vc6).
>

did that too.

> Set the Linker->Input->Additional Dependencies option to "libcurld.lib
> wsock32.lib libeay32.lib ssleay32.lib winmm.lib".
>

OK, I was using ws2_32.lib but have tried both now with the same result

> Set C/C++->Preprocessor->Preprocessor Definitions to
> "WIN32;_DEBUG;_CONSOLE;CURL_STATICLIB".
>

done.

> Build your program in debug configuration and enjoy !
>

I want to enjoy, I'm trying very hard to enjoy, but I just keep getting
uncaught exception at the WaitForSingleObject call in hostthre.c on line
604. I've tried stepping through the code, and that will sometimes get me
past line 604, but then I get the same thing on the next call at line 20.

vc++ breaks at the end of _CrtIsValidHeapPointe in dbgheap.c. This is the
exact same behavior I saw inside my MFC app after getting it to compile.
Should it be using MsgWaitForMultipleObjects[Ex] instead?

> The key was to define CURL_STATICLIB macro.
>
> > res = curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
>
> Have you read documentation for this option ?
>

Yeah, I did read the docs for that function and initially I wasn't using it
at all, then I tried using a file pointer, then I did that because it was in
one of the sample programs that come with libcurl and I'm now guessing the
sample program is perhaps out of date. Regardless the original problem
continues to plague me before it ever has a chance to get to the point where
it looks at that anyway.
Received on 2005-09-02