LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to compile libcURLpp (https://www.linuxquestions.org/questions/programming-9/how-to-compile-libcurlpp-419923/)

lucky6969b 02-26-2006 09:47 PM

How to compile libcURLpp
 
Hi,
I just ran into problems with compiling libcurlpp
This happened on a clean installation

[root@localhost curlpp-0.5.2]# make
make all-recursive
make[1]: Entering directory `/root/Desktop/curlpp/curlpp-0.5.2'
Making all in curlpp
make[2]: Entering directory `/root/Desktop/curlpp/curlpp-0.5.2/curlpp'
if /bin/sh ../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../ -g -W -Wall -Werror -I/usr/local/include -MT CurlHandle.lo -MD -MP -MF ".deps/CurlHandle.Tpo" -c -o CurlHandle.lo CurlHandle.cpp; \
then mv -f ".deps/CurlHandle.Tpo" ".deps/CurlHandle.Plo"; else rm -f ".deps/CurlHandle.Tpo"; exit 1; fi
cc1plus: warnings being treated as errors
OptionBase.hpp:39: warning: 'class cURLpp::OptionBase' has virtual functions but non-virtual destructor
make[2]: *** [CurlHandle.lo] Error 1
make[2]: Leaving directory `/root/Desktop/curlpp/curlpp-0.5.2/curlpp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Desktop/curlpp/curlpp-0.5.2'
make: *** [all] Error 2



Thx
Jack

lucky6969b 02-26-2006 10:01 PM

linking unittest (g++)
Webcam.o(.gnu.linkonce.r._ZTVN6cURLpp11OptionTraitISsL10CURLoption10002EEE[vtable for cURLpp::OptionTrait<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, (CURLoption)10002>]+0x10): undefined reference to `cURLpp::OptionBase::operator<(cURLpp::OptionBase const&) const'
Webcam.o(.gnu.linkonce.r._ZTIN6cURLpp6OptionISsEE[typeinfo for cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]+0x8): undefined reference to `typeinfo for cURLpp::OptionBase'
Webcam.o(.gnu.linkonce.r._ZTIN6cURLpp11UnsetOptionE[typeinfo for cURLpp::UnsetOption]+0x8): undefined reference to `typeinfo for cURLpp::RuntimeError'
Webcam.o(.gnu.linkonce.r._ZTVN6cURLpp6OptionISsEE[vtable for cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]+0x10): undefined reference to `cURLpp::OptionBase::operator<(cURLpp::OptionBase const&) const'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp11UnsetOptionD1Ev[cURLpp::UnsetOption::~UnsetOption()]+0xe): In function `cURLpp::UnsetOption::~UnsetOption()':
/usr/local/include/curlpp/Option.inl:91: undefined reference to `cURLpp::RuntimeError::~RuntimeError()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp11UnsetOptionD0Ev[cURLpp::UnsetOption::~UnsetOption()]+0x12): In function `cURLpp::UnsetOption::~UnsetOption()':
/usr/local/include/curlpp/Option.inl:91: undefined reference to `cURLpp::RuntimeError::~RuntimeError()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp10CurlHandle6optionIPvEEv10CURLoptionT_[void cURLpp::CurlHandle::option<void*>(CURLoption, void*)]+0x29): In function `void cURLpp::CurlHandle::option<void*>(CURLoption, void*)':
/usr/local/include/curlpp/CurlHandle.inl:36: undefined reference to `cURLpp::libcurlRuntimeAssert(char const*, CURLcode)'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED2Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x45): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()':
/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED2Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x3a):/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED1Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x45): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()':
/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED1Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x3a):/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED0Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x35): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()':
/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED0Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x51):/usr/local/include/curlpp/Option.inl:63: more undefined references to `cURLpp::OptionBase::~OptionBase()' follow
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsEC2E10CURLoptionRKSs[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Option(CURLoption, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x10): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Option(CURLoption, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/curlpp/Option.inl:35: undefined reference to `cURLpp::OptionBase::OptionBase(CURLoption)'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsEC2E10CURLoptionRKSs[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Option(CURLoption, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x3d):/usr/local/include/curlpp/Option.inl:37: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZNK6cURLpp6OptionISsE8getValueEv[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::getValue() const]+0x5b): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::getValue() const':
/usr/local/include/curlpp/Option.inl:111: undefined reference to `cURLpp::UnsetOption::UnsetOption(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsE16updateMeToOptionERKNS_10OptionBaseE[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::updateMeToOption(cURLpp::OptionBase const&)]+0x17): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::updateMeToOption(cURLpp::OptionBase const&)':
/usr/local/include/curlpp/Option.inl:88: undefined reference to `typeinfo for cURLpp::OptionBase'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsE16updateMeToOptionERKNS_10OptionBaseE[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::updateMeToOption(cURLpp::OptionBase const&)]+0x69):/usr/local/include/curlpp/Option.inl:91: undefined reference to `cURLpp::UnsetOption::UnsetOption(char const*)'
Webcam.o(.gnu.linkonce.t._ZNK6cURLpp11OptionTraitISsL10CURLoption10002EE16updateHandleToMeEPNS_10Cur lHandleE[cURLpp::OptionTrait<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, (CURLoption)10002>::updateHandleToMe(cURLpp::CurlHandle*) const]+0x63): In function `cURLpp::OptionTrait<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, (CURLoption)10002>::updateHandleToMe(cURLpp::CurlHandle*) const':
/usr/local/include/curlpp/Option.inl:141: undefined reference to `cURLpp::UnsetOption::UnsetOption(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: ld returned 1 exit status
gmake: *** [unittest] Error 1
gmake: Target `all' not remade because of errors.
*** Exited with status: 2 ***

I used 0.6 version, but still has this linking errors, any hints
Thanks
Jack

lucky6969b 02-26-2006 10:02 PM

linking unittest (g++)
Webcam.o(.gnu.linkonce.r._ZTVN6cURLpp11OptionTraitISsL10CURLoption10002EEE[vtable for cURLpp::OptionTrait<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, (CURLoption)10002>]+0x10): undefined reference to `cURLpp::OptionBase::operator<(cURLpp::OptionBase const&) const'
Webcam.o(.gnu.linkonce.r._ZTIN6cURLpp6OptionISsEE[typeinfo for cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]+0x8): undefined reference to `typeinfo for cURLpp::OptionBase'
Webcam.o(.gnu.linkonce.r._ZTIN6cURLpp11UnsetOptionE[typeinfo for cURLpp::UnsetOption]+0x8): undefined reference to `typeinfo for cURLpp::RuntimeError'
Webcam.o(.gnu.linkonce.r._ZTVN6cURLpp6OptionISsEE[vtable for cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]+0x10): undefined reference to `cURLpp::OptionBase::operator<(cURLpp::OptionBase const&) const'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp11UnsetOptionD1Ev[cURLpp::UnsetOption::~UnsetOption()]+0xe): In function `cURLpp::UnsetOption::~UnsetOption()':
/usr/local/include/curlpp/Option.inl:91: undefined reference to `cURLpp::RuntimeError::~RuntimeError()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp11UnsetOptionD0Ev[cURLpp::UnsetOption::~UnsetOption()]+0x12): In function `cURLpp::UnsetOption::~UnsetOption()':
/usr/local/include/curlpp/Option.inl:91: undefined reference to `cURLpp::RuntimeError::~RuntimeError()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp10CurlHandle6optionIPvEEv10CURLoptionT_[void cURLpp::CurlHandle::option<void*>(CURLoption, void*)]+0x29): In function `void cURLpp::CurlHandle::option<void*>(CURLoption, void*)':
/usr/local/include/curlpp/CurlHandle.inl:36: undefined reference to `cURLpp::libcurlRuntimeAssert(char const*, CURLcode)'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED2Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x45): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()':
/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED2Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x3a):/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED1Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x45): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()':
/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED1Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x3a):/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED0Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x35): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()':
/usr/local/include/curlpp/Option.inl:63: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsED0Ev[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Option()]+0x51):/usr/local/include/curlpp/Option.inl:63: more undefined references to `cURLpp::OptionBase::~OptionBase()' follow
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsEC2E10CURLoptionRKSs[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Option(CURLoption, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x10): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Option(CURLoption, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/curlpp/Option.inl:35: undefined reference to `cURLpp::OptionBase::OptionBase(CURLoption)'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsEC2E10CURLoptionRKSs[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Option(CURLoption, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x3d):/usr/local/include/curlpp/Option.inl:37: undefined reference to `cURLpp::OptionBase::~OptionBase()'
Webcam.o(.gnu.linkonce.t._ZNK6cURLpp6OptionISsE8getValueEv[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::getValue() const]+0x5b): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::getValue() const':
/usr/local/include/curlpp/Option.inl:111: undefined reference to `cURLpp::UnsetOption::UnsetOption(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsE16updateMeToOptionERKNS_10OptionBaseE[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::updateMeToOption(cURLpp::OptionBase const&)]+0x17): In function `cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::updateMeToOption(cURLpp::OptionBase const&)':
/usr/local/include/curlpp/Option.inl:88: undefined reference to `typeinfo for cURLpp::OptionBase'
Webcam.o(.gnu.linkonce.t._ZN6cURLpp6OptionISsE16updateMeToOptionERKNS_10OptionBaseE[cURLpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::updateMeToOption(cURLpp::OptionBase const&)]+0x69):/usr/local/include/curlpp/Option.inl:91: undefined reference to `cURLpp::UnsetOption::UnsetOption(char const*)'
Webcam.o(.gnu.linkonce.t._ZNK6cURLpp11OptionTraitISsL10CURLoption10002EE16updateHandleToMeEPNS_10Cur lHandleE[cURLpp::OptionTrait<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, (CURLoption)10002>::updateHandleToMe(cURLpp::CurlHandle*) const]+0x63): In function `cURLpp::OptionTrait<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, (CURLoption)10002>::updateHandleToMe(cURLpp::CurlHandle*) const':
/usr/local/include/curlpp/Option.inl:141: undefined reference to `cURLpp::UnsetOption::UnsetOption(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: ld returned 1 exit status
gmake: *** [unittest] Error 1
gmake: Target `all' not remade because of errors.
*** Exited with status: 2 ***

I used the 0.6 version, but still got this link time error, any hints?
Thx
Jack

lucky6969b 02-26-2006 10:19 PM

linking unittest (g++)
Webcam.o(.text+0x644): In function `WebCam::SnapImage(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/home/Jacky/Projects/RMVES/Ver1_0a/Webcam.cpp:120: undefined reference to `cURLpp::Cleanup::Cleanup()'
Webcam.o(.text+0x692):/home/Jacky/Projects/RMVES/Ver1_0a/Webcam.cpp:122: undefined reference to `cURLpp::Cleanup::~Cleanup()'
Webcam.o(.text+0x81c):/home/Jacky/Projects/RMVES/Ver1_0a/Webcam.cpp:122: undefined reference to `cURLpp::Cleanup::~Cleanup()'

=====================================
try {
cURLpp::Cleanup myCleanup;

cURLpp::Options::Url myUrl ("192.168.0.124/oneshotimage.jpg");
} catch (cURLpp::RuntimeError &e)
{
std::cout << e.what() << std::endl;
} catch (cURLpp::LogicError &e)
{
std::cout << e.what() << std::endl;
}

I basically followed the example, and the example could be compiled
Thanks
Jack


All times are GMT -5. The time now is 11:53 PM.