0
votes

I am attempting to use cURLpp as an avenue for retrieving data from a weather website for a final project in my C++ class. I am using Eclipse as an IDE and MinGW as my compiler. All I want to be able to do is send a GET request to the weather API and retrieve the data that is returned. I have done some extensive research, and it appeared that cURLpp was the way to go.

I have spent hours trying to get it configured in Eclipse and I'm still getting errors. I downloaded both libcURL and cURLpp. I am not sure if the versions I downloaded are correct though. The names of the files I downloaded are:

"curlpp-0.7.3.tar.gz" and "curl-7.22.0-devel-mingw32.zip"

Once I downloaded these two files, I extracted them both to an arbitrary directory. In eclipse, I added to my Includes path:

"C:\FinalProgrammingProjectData\cURL\curlpp-0.7.3.tar\curlpp-0.7.3\include" "C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\curl-7.22.0-devel-mingw32\include"

I added to my Library Paths: "C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib"

Under the libraries tab, I added the names of the individual files that are located inside: "C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib"

When I try to build my project, I get alot of errors saying something along the lines of:

"undefined reference to"

Does anyone have any idea what my problem might be? I haven't written any of my own code. I've just been trying to compile the first example that is included with the cURLpp download. If anyone can offer any insight, I'd be most grateful. I have been wrestling with this for hours and haven't made much progress.

Thank You

P.S. Here is the build configuration with a list of the errors

Build of configuration Debug for project curlTest **

Internal Builder is used for build ** g++ -LC:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib -LC:\FinalProgrammingProjectData\cURL\curlpp-0.7.3.tar\curlpp-0.7.3\src -o curlTest.exe curlTest.o -lcurl -lidn.dll -lrtmp -lssh2 -lssh2dll -lssl -lssl32 -lz -lzdll -leay32 -lidn -lcurldll -lcrypto curlTest.o: In function main': C:\Users\Owner\Desktop\School\Fall 2011\EEL3834\Eclipse Projects\curlTest\Debug/../curlTest.cpp:32: undefined reference toimpZlsRSoRKN6curlpp11OptionTraitISsL10CURLoption10002EEE' C:\Users\Owner\Desktop\School\Fall 2011\EEL3834\Eclipse Projects\curlTest\Debug/../curlTest.cpp:37: undefined reference to _imp___ZlsRSoRKN6curlpp11OptionTraitISsL10CURLoption10002EEE' curlTest.o: In function~OptionTrait': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.hpp:147: undefined reference to _imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE' curlTest.o: In functionOptionTrait': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:124: undefined reference to _imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE' curlTest.o: In function~Option': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to _imp___ZTVN6curlpp6OptionISsEE' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to_imp_ZN6curlpp10OptionBaseD2Ev' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to _imp___ZN6curlpp10OptionBaseD2Ev' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference toimpZTVN6curlpp6OptionISsEE' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to _imp___ZN6curlpp10OptionBaseD2Ev' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to_imp_ZN6curlpp10OptionBaseD2Ev' curlTest.o: In function Option': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42: undefined reference toimpZN6curlpp10OptionBaseC2E10CURLoption' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42: undefined reference to _imp___ZTVN6curlpp6OptionISsEE' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42: undefined reference to_imp_ZN6curlpp10OptionBaseD2Ev' curlTest.o:curlTest.cpp:(.rdata$_ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE[vtable for curlpp::OptionTrait, std::allocator >, (CURLoption)10002>]+0x10): undefined reference to curlpp::OptionBase::operator<(curlpp::OptionBase const&) const' curlTest.o:curlTest.cpp:(.rdata$_ZTVN6curlpp6OptionISsEE[vtable for curlpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]+0x10): undefined reference tocurlpp::OptionBase::operator<(curlpp::OptionBase const&) const' curlTest.o: In function ~UnsetOption': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/internal/../Exception.hpp:143: undefined reference toimpZN6curlpp12RuntimeErrorD2Ev' curlTest.o: In function ZN6curlpp6OptionISsE16updateMeToOptionERKNS_10OptionBaseE': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:96: undefined reference to_imp_ZN6curlpp11UnsetOptionC1EPKc' curlTest.o: In function ZNK6curlpp11OptionTraitISsL10CURLoption10002EE16updateHandleToMeEPNS_8internal10CurlHandleE': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:148: undefined reference toimpZN6curlpp11UnsetOptionC1ERKSs' curlTest.o: In function ZNK6curlpp6OptionISsE8getValueEv': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:114: undefined reference to_imp_ZN6curlpp11UnsetOptionC1ERKSs' curlTest.o: In function ZN6curlpp8internal10CurlHandle6optionIPvEEv10CURLoptionT_': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/internal/CurlHandle.inl:47: undefined reference toimp__ZN6curlpp20libcurlRuntimeAssertEPKc8CURLcode' collect2: ld returned 1 exit status Build error occurred, build is stopped Time consumed: 576 ms.

1

1 Answers

0
votes

I decided against using cURLpp. I got libcURL to work on its own. There were just too many dependencies between cURLpp and libcURL.

Thanks