cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: a question about libcurl.dll

From: Tomer Fishaimer <tomerf_at_advantech.co.il>
Date: Tue, 17 Jul 2007 12:48:56 +0300

Hi,

I realized that I'm not linking it, the problem is how to link it.

Like I said I'm new to c++ so I'm not familiar with the command line.

The eclipse compiler is using the default "make -k" when building the
project,

I tried writing something like "make -k -L C:\curl-7.16.4\lib"

But it didn't work, it was compiled with "make -k -L all".

Can you please give me the complete command if I'm using cygcurl-2.dll?

 

Thanks.

 

 

Tomer Fishaimer

 

J2EE Developer

 

Advantech Technologies Ltd.

 

Email: tomerf_at_advantech.co.il

 

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Tim Tassonis
Sent: Tuesday, July 17, 2007 12:33 PM
To: libcurl development
Subject: Re: a question about libcurl.dll

 

Hi

 

> g++ -o"connecit_uterasoft.exe" ./src/ApplicationInfo.o
./src/CPUInfo.o

> ./src/ConnectionPoolInfo.o ./src/EJBPoolInfo.o ./src/JVMInfo.o

> ./src/httpTest.o ./src/testXML.o ./src/xmlParser.o

> ./src/objects/ApplicationObject.o ./src/objects/CPUObject.o

> ./src/objects/ConnectionPoolObject.o ./src/objects/EJBPoolObject.o

> ./src/objects/JVMObject.o ./src/objects/ServerData.o

> ./src/fileHandler/PropFileHandler.o ./src/constants/Constants.o

 

 

You're not linking the curl library to your program. Something like:

 

-L\path\to\curl_library -lcurldll

 

 

 

Tomer Fishaimer wrote:

> Hi,

>

> I'm a java programmer, but now I received a c++ project. I need to use

> the libcurl HTTP abilities.

>

> I'm using a cygwin plugin on the eclipse (a g++ compiler) and I tried
to

> add the libcurl.dll to my project.

>

> I tried running a little example from the curl package I downloaded
but

> I keep getting errors.

>

> The example is :

>

>

>

>
/***********************************************************************
******

>

> * _ _ ____ _

>

> * Project ___| | | | _ \| |

>

> * / __| | | | |_) | |

>

> * | (__| |_| | _ <| |___

>

> * \___|\___/|_| \_\_____|

>

> *

>

> * $Id: http-post.c,v 1.2 2004/11/22 14:41:36 bagder Exp $

>

> */

>

>

>

> #include <stdio.h>

>

> #include <curl/curl.h>

>

>

>

> int main(void)

>

> {

>

> CURL *curl;

>

> CURLcode res;

>

>

>

> curl = curl_easy_init();

>

> if(curl) {

>

> /* First set the URL that is about to receive our POST. This URL
can

>

> just as well be a https:// URL if that is what should receive
the

>

> data. */

>

> curl_easy_setopt(curl, CURLOPT_URL,

> "http://postit.example.com/moo.cgi");

>

> /* Now specify the POST data */

>

> curl_easy_setopt(curl, CURLOPT_POSTFIELDS,
"name=daniel&project=curl");

>

>

>

> /* Perform the request, res will get the return code */

>

> res = curl_easy_perform(curl);

>

>

>

> /* always cleanup */

>

> curl_easy_cleanup(curl);

>

> }

>

> return 0;

>

> }

>

>

>

> And the error is :

>

>

>

>

>

> **** Build of configuration Debug for project connecit_uterasoft ****

>

>

>

> make -k all

>

> Building target: connecit_uterasoft.exe

>

> Invoking: GCC C++ Linker

>

> g++ -o"connecit_uterasoft.exe" ./src/ApplicationInfo.o
./src/CPUInfo.o

> ./src/ConnectionPoolInfo.o ./src/EJBPoolInfo.o ./src/JVMInfo.o

> ./src/httpTest.o ./src/testXML.o ./src/xmlParser.o

> ./src/objects/ApplicationObject.o ./src/objects/CPUObject.o

> ./src/objects/ConnectionPoolObject.o ./src/objects/EJBPoolObject.o

> ./src/objects/JVMObject.o ./src/objects/ServerData.o

> ./src/fileHandler/PropFileHandler.o ./src/constants/Constants.o

>

> ./src/httpTest.o: In function `main':

>

>
/cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.c
pp:19:

> undefined reference to `_curl_easy_init'

>

>
/cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.c
pp:24:

> undefined reference to `_curl_easy_setopt'

>

>
/cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.c
pp:26:

> undefined reference to `_curl_easy_setopt'

>

>
/cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.c
pp:29:

> undefined reference to `_curl_easy_perform'

>

>
/cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.c
pp:32:

> undefined reference to `_curl_easy_cleanup'

>

> collect2: ld returned 1 exit status

>

> make: *** [connecit_uterasoft.exe] Error 1

>

> make: Target `all' not remade because of errors.

>

> Build complete for project connecit_uterasoft

>

>

>

> Can you please tell me what am I doing wrong?

>

>

>

> P.S

>

> I tried adding the easy.c file and it solved this problem, but then it

> didn't recognize all the include in the easy.c file L

>

>

>

> Thanks.

>

>

>

> */Tomer Fishaimer/*

>

> *J2EE Developer*

>

> *Advantech Technologies Ltd.*

>

> *Email**: **tomerf_at_advantech.co.il <mailto:tomerf_at_advantech.co.il>***

>

>

>

 
Received on 2007-07-17