problem with cygcurl-2.dll

Reply

Join Date: Jul 2007
Posts: 4
Reputation: ftom2 is an unknown quantity at this point 
Solved Threads: 0
ftom2 ftom2 is offline Offline
Newbie Poster

problem with cygcurl-2.dll

 
0
  #1
Jul 16th, 2007
Hi,
i'm trying to use cygcurl-2.dll, i downloaded a simple example from curl site bur i'm not able to compile it properly. the example is this:

  1. #include <stdio.h>
  2. #include <curl/curl.h>
  3.  
  4. int main(void)
  5. {
  6. CURL *curl;
  7. CURLcode res;
  8.  
  9. curl = curl_easy_init();
  10. if(curl) {
  11. /* First set the URL that is about to receive our POST. This URL can
  12.   just as well be a https:// URL if that is what should receive the
  13.   data. */
  14. curl_easy_setopt(curl, CURLOPT_URL, "http://postit.example.com/moo.cgi");
  15. /* Now specify the POST data */
  16. curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "name=daniel&project=curl");
  17.  
  18. /* Perform the request, res will get the return code */
  19. res = curl_easy_perform(curl);
  20.  
  21. /* always cleanup */
  22. curl_easy_cleanup(curl);
  23. }
  24. return 0;
  25. }

the compiler recognizes the include of the header, but for all the rest i get : "undefined reference to `_curl_easy_init'" etc.

what am i doing wrong?
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,851
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: problem with cygcurl-2.dll

 
0
  #2
Jul 16th, 2007
Which compiler are you using. I'm guessing that it's gcc with cygwin, since that's the library you mention.

What command line did you try?
It needs to be something like
gcc prog.c -lcurl
The part at the end is what tells the compiler that you're interested in using curl functionality.

Obviously, you need to find the correct name for your library to substitute in that command line.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 4
Reputation: ftom2 is an unknown quantity at this point 
Solved Threads: 0
ftom2 ftom2 is offline Offline
Newbie Poster

Re: problem with cygcurl-2.dll

 
0
  #3
Jul 16th, 2007
Thanks for your answear.
yes, i'm using gcc g++, but i'm actually using it as a plugin for eclipse, so i compile my files with eclipse.
i tried importing the dll to my project, but like i said i get these errors.
maybe you can make something out of it:

  1.  
  2. **** Build of configuration Debug for project connecit_uterasoft ****
  3.  
  4. make -k all
  5. Building target: connecit_uterasoft.exe
  6. Invoking: GCC C++ Linker
  7. g++ -o"connecit_uterasoft.exe" ./src/ApplicationInfo.o ./src/CPUInfo.o ./src/ConnectionPoolInfo.o ./src/EJBPoolInfo.o ./src/JVMInfo.o ./src/http-post.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
  8. ./src/httpTest.o: In function `main':
  9. /cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:56: undefined reference to `_curl_easy_init'
  10. /cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:61: undefined reference to `_curl_easy_setopt'
  11. /cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:62: undefined reference to `_curl_easy_setopt'
  12. /cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:63: undefined reference to `_curl_easy_setopt'
  13. /cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:64: undefined reference to `_curl_easy_setopt'
  14. /cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:65: undefined reference to `_curl_easy_setopt'
  15. ./src/httpTest.o:/cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:66: more undefined references to `_curl_easy_setopt' follow
  16. ./src/httpTest.o: In function `main':
  17. /cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:69: undefined reference to `_curl_easy_perform'
  18. /cygdrive/d/eclipse/workspace/connecit_uterasoft/Debug/../src/httpTest.cpp:72: undefined reference to `_curl_easy_cleanup'
  19. collect2: ld returned 1 exit status
  20. make: *** [connecit_uterasoft.exe] Error 1
  21. make: Target `all' not remade because of errors.
  22. Build complete for project connecit_uterasoft

like i said, it recognizes the #include <curl/curl.h> but not the commands that come after.

originally i come from java world, so i'm not very familiar with c++, so i'd appriciate it if you can give it to me in laim terms .
Last edited by ftom2; Jul 16th, 2007 at 9:17 am. Reason: added some lines
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC