cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl compiles w/ MinGW but doesn't work

From: Dave Compton <abcdave_at_fastmail.fm>
Date: Mon, 13 Mar 2006 10:23:17 -0800

My guess is that either you don't have libcurl configured correctly or
your executable is not finding the correct libcurl dll at run time.

I'm also using libcurl with mingw and I was able to compile and run your
example with no problems. Here are some details ( of course the
pathnames need to be modifed to match your environment ).

-----------------------------------------------------------------------------------------------
My environment:
I'm using mingw in a cygwin environment. The first thing in my PATH is
"/cygdrive/c/mingw/bin" .

-----------------------------------------------------------------------------------------------
Libcurl configuration:
Here are the commands I use to configure and install libcurl:

./configure --build=mingw32
--prefix=c:/cygwin_home/dave/thirdParty/Cygwin/curl/curl-7.15.2/install
make
make install

-----------------------------------------------------------------------------------------------
Building Your Example:

Here are the commands I used to build your example.
dave_at_possum:~/src/curlTest$ rm *.o
dave_at_possum:~/src/curlTest$ make
g++ -g
-Ic:/cygwin_home/dave/thirdParty/Cygwin/curl/curl-7.15.2/install/include
-c -o sample.o sample.cpp
g++ -o sample sample.o
-Lc:/cygwin_home/dave/thirdParty/Cygwin/curl/curl-7.15.2/install/lib -lcurl
dave_at_possum:~/src/curlTest$ which g++
/cygdrive/c/mingw/bin/g++
dave_at_possum:~/src/curlTest$

-----------------------------------------------------------------------------------------------
Running Your Example:

You need to make sure that your executable can find the correct lib curl dll

The easiest way to do this is to copy the dll into the same directory
that the executable is running in.

-----------------------------------------------------------------------------------------------
Testing shared library dependencies:

I use depends.exe ( downloadable from http://www.windll.com/ ) to verify
that my executable is using the right dll.

-----------------------------------------------------------------------------------------------

Hope this helps.

- Dave
Received on 2006-03-13