jpbarrette/curlpp

Please help - Curlpp build errors

stemuser027 opened this issue · 1 comments

I am trying to use Curlpp for the first time and tried to use the example you have at the link below:
https://github.com/jpbarrette/curlpp/blob/master/examples/example22.cpp

I used Nuget to install Curlpp for Visual Studio 2017

and get a lot of errors. What I'm I doing wrong

Please can you help me. Thank you so much.

1>------ Build started: Project: TestCurl, Configuration: Debug Win32 ------
1>TestCurl.cpp
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\exception.hpp(49): warning C4275: non dll-interface class 'std::runtime_error' used as base for dll-interface class 'curlpp::RuntimeError'
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\stdexcept(157): note: see declaration of 'std::runtime_error'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\exception.hpp(48): note: see declaration of 'curlpp::RuntimeError'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\exception.hpp(70): warning C4275: non dll-interface class 'std::logic_error' used as base for dll-interface class 'curlpp::LogicError'
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\stdexcept(17): note: see declaration of 'std::logic_error'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\exception.hpp(69): note: see declaration of 'curlpp::LogicError'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\curlhandle.hpp(183): warning C4251: 'curlpp::internal::CurlHandle::mWriteFunctor': class 'utilspp::Functor<size_t,utilspp::tl::TypeList<char *,utilspp::tl::TypeList<size_t,utilspp::tl::TypeList<size_t,utilspp::NullType>>>>' needs to have dll-interface to be used by clients of class 'curlpp::internal::CurlHandle'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\types.hpp(45): note: see declaration of 'utilspp::Functor<size_t,utilspp::tl::TypeList<char *,utilspp::tl::TypeList<size_t,utilspp::tl::TypeList<size_t,utilspp::NullType>>>>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\curlhandle.hpp(184): warning C4251: 'curlpp::internal::CurlHandle::mHeaderFunctor': class 'utilspp::Functor<size_t,utilspp::tl::TypeList<char *,utilspp::tl::TypeList<size_t,utilspp::tl::TypeList<size_t,utilspp::NullType>>>>' needs to have dll-interface to be used by clients of class 'curlpp::internal::CurlHandle'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\types.hpp(45): note: see declaration of 'utilspp::Functor<size_t,utilspp::tl::TypeList<char *,utilspp::tl::TypeList<size_t,utilspp::tl::TypeList<size_t,utilspp::NullType>>>>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\curlhandle.hpp(185): warning C4251: 'curlpp::internal::CurlHandle::mReadFunctor': class 'utilspp::Functor<size_t,utilspp::tl::TypeList<char *,utilspp::tl::TypeList<size_t,utilspp::tl::TypeList<size_t,utilspp::NullType>>>>' needs to have dll-interface to be used by clients of class 'curlpp::internal::CurlHandle'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\types.hpp(45): note: see declaration of 'utilspp::Functor<size_t,utilspp::tl::TypeList<char *,utilspp::tl::TypeList<size_t,utilspp::tl::TypeList<size_t,utilspp::NullType>>>>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\curlhandle.hpp(186): warning C4251: 'curlpp::internal::CurlHandle::mProgressFunctor': class 'utilspp::Functor<int,utilspp::tl::TypeList<double,utilspp::tl::TypeList<double,utilspp::tl::TypeList<double,utilspp::tl::TypeList<double,utilspp::NullType>>>>>' needs to have dll-interface to be used by clients of class 'curlpp::internal::CurlHandle'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\types.hpp(64): note: see declaration of 'utilspp::Functor<int,utilspp::tl::TypeList<double,utilspp::tl::TypeList<double,utilspp::tl::TypeList<double,utilspp::tl::TypeList<double,utilspp::NullType>>>>>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\curlhandle.hpp(187): warning C4251: 'curlpp::internal::CurlHandle::mDebugFunctor': class 'utilspp::Functor<int,utilspp::tl::TypeList<curl_infotype,utilspp::tl::TypeList<char *,utilspp::tl::TypeList<size_t,utilspp::NullType>>>>' needs to have dll-interface to be used by clients of class 'curlpp::internal::CurlHandle'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\types.hpp(54): note: see declaration of 'utilspp::Functor<int,utilspp::tl::TypeList<curl_infotype,utilspp::tl::TypeList<char *,utilspp::tl::TypeList<size_t,utilspp::NullType>>>>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\curlhandle.hpp(188): warning C4251: 'curlpp::internal::CurlHandle::mSslFunctor': class 'utilspp::Functor<CURLcode,utilspp::tl::TypeList<void *,utilspp::NullType>>' needs to have dll-interface to be used by clients of class 'curlpp::internal::CurlHandle'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\types.hpp(60): note: see declaration of 'utilspp::Functor<CURLcode,utilspp::tl::TypeList<void *,utilspp::NullType>>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optionlist.hpp(110): warning C4251: 'curlpp::internal::OptionList::mOptions': class 'std::map<CURLoption,curlpp::OptionBase *,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>' needs to have dll-interface to be used by clients of class 'curlpp::internal::OptionList'
1> with
1> [
1> _Kty=CURLoption,
1> _Ty=curlpp::OptionBase *
1> ]
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optionlist.hpp(52): note: see declaration of 'std::map<CURLoption,curlpp::OptionBase *,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>'
1> with
1> [
1> _Kty=CURLoption,
1> _Ty=curlpp::OptionBase *
1> ]
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\slist.hpp(77): warning C4251: 'curlpp::internal::SList::mData': class 'std::list<std::string,std::allocator<_Ty>>' needs to have dll-interface to be used by clients of class 'curlpp::internal::SList'
1> with
1> [
1> _Ty=std::string
1> ]
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\slist.hpp(60): note: see declaration of 'std::list<std::string,std::allocator<_Ty>>'
1> with
1> [
1> _Ty=std::string
1> ]
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\form.hpp(91): warning C4251: 'curlpp::HttpPost::mForms': class 'std::list<utilspp::clone_ptrcurlpp::FormPart,std::allocator<_Ty>>' needs to have dll-interface to be used by clients of class 'curlpp::HttpPost'
1> with
1> [
1> _Ty=utilspp::clone_ptrcurlpp::FormPart
1> ]
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\form.hpp(44): note: see declaration of 'std::list<utilspp::clone_ptrcurlpp::FormPart,std::allocator<_Ty>>'
1> with
1> [
1> _Ty=utilspp::clone_ptrcurlpp::FormPart
1> ]
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\form.hpp(132): warning C4251: 'curlpp::FormPart::mName': class 'std::basic_string<char,std::char_traits,std::allocator>' needs to have dll-interface to be used by clients of class 'curlpp::FormPart'
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xstring(4373): note: see declaration of 'std::basic_string<char,std::char_traits,std::allocator>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\form.hpp(197): warning C4251: 'curlpp::FormParts::File::mFilename': class 'std::basic_string<char,std::char_traits,std::allocator>' needs to have dll-interface to be used by clients of class 'curlpp::FormParts::File'
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xstring(4373): note: see declaration of 'std::basic_string<char,std::char_traits,std::allocator>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\form.hpp(198): warning C4251: 'curlpp::FormParts::File::mContentType': class 'std::basic_string<char,std::char_traits,std::allocator>' needs to have dll-interface to be used by clients of class 'curlpp::FormParts::File'
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xstring(4373): note: see declaration of 'std::basic_string<char,std::char_traits,std::allocator>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\form.hpp(259): warning C4251: 'curlpp::FormParts::Content::mContent': class 'std::basic_string<char,std::char_traits,std::allocator>' needs to have dll-interface to be used by clients of class 'curlpp::FormParts::Content'
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xstring(4373): note: see declaration of 'std::basic_string<char,std::char_traits,std::allocator>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\form.hpp(260): warning C4251: 'curlpp::FormParts::Content::mContentType': class 'std::basic_string<char,std::char_traits,std::allocator>' needs to have dll-interface to be used by clients of class 'curlpp::FormParts::Content'
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xstring(4373): note: see declaration of 'std::basic_string<char,std::char_traits,std::allocator>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optioncontainer.inl(39): error C2491: 'curlpp::internal::OptionContainer::OptionContainer': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optioncontainer.inl(45): error C2491: 'curlpp::internal::OptionContainer::OptionContainer': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optioncontainer.inl(53): error C2491: 'curlpp::internal::OptionContainer::setValue': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optioncontainer.inl(60): error C2491: 'curlpp::internal::OptionContainer::getValue': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optioncontainer.inl(67): error C2491: 'curlpp::internal::OptionContainer::getHandleOptionValue': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optionsetter.inl(36): error C2491: 'curlpp::internal::OptionSetter<OptionValueType,optionType>::setOpt': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optionsetter.inl(45): error C2491: 'curlpp::internal::OptionSetterstd::string,optionType::setOpt': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optionsetter.inl(54): error C2491: 'curlpp::internal::OptionSetter<std::list<std::string,std::allocator<_Ty>>,optionType>::setOpt': definition of dllimport function not allowed
1> with
1> [
1> _Ty=std::string
1> ]
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(45): error C2491: 'curlpp::Option::Option': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(52): error C2491: 'curlpp::Option::Option': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(63): error C2491: 'curlpp::Option::Option': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(71): error C2491: 'curlpp::Option::~Option': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(86): error C2491: 'curlpp::Option::setValue': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(99): error C2491: 'curlpp::Option::updateMeToOption': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(107): error C2491: 'curlpp::Option::clear': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(117): error C2491: 'curlpp::Option::getValue': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(125): error C2491: 'curlpp::OptionTrait<OptionType,opt>::OptionTrait': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(131): error C2491: 'curlpp::OptionTrait<OptionType,opt>::OptionTrait': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(139): error C2491: 'curlpp::OptionTrait<OptionType,opt>::clone': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(152): error C2491: 'curlpp::OptionTrait<OptionType,opt>::updateHandleToMe': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(160): error C2491: 'curlpp::NoValueOptionTrait::NoValueOptionTrait': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(168): error C2491: 'curlpp::NoValueOptionTrait::clone': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(178): error C2491: 'curlpp::NotAvailableOptionTrait::NotAvailableOptionTrait': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(185): error C2491: 'curlpp::NotAvailableOptionTrait::NotAvailableOptionTrait': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(193): error C2491: 'curlpp::NotAvailableOptionTrait::clone': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.inl(201): error C2491: 'curlpp::NotAvailableOptionTrait::updateHandleToMe': definition of dllimport function not allowed
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\easy.hpp(154): warning C4251: 'curlpp::Easy::mCurl': class 'std::auto_ptrcurlpp::internal::CurlHandle' needs to have dll-interface to be used by clients of class 'curlpp::Easy'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\curlhandle.hpp(58): note: see declaration of 'std::auto_ptrcurlpp::internal::CurlHandle'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\internal\optioncontainer.hpp(93): warning C4251: 'curlpp::internal::OptionContainer<std::basic_string<char,std::char_traits,std::allocator>>::mValue': class 'std::basic_string<char,std::char_traits,std::allocator>' needs to have dll-interface to be used by clients of class 'curlpp::internal::OptionContainer<std::basic_string<char,std::char_traits,std::allocator>>'
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xstring(4373): note: see declaration of 'std::basic_string<char,std::char_traits,std::allocator>'
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.hpp(55): note: see reference to class template instantiation 'curlpp::internal::OptionContainer<std::basic_string<char,std::char_traits,std::allocator>>' being compiled
1>c:\users\josep\source\repos\testcurl\packages\curlpp.0.7.3.1\build\native\include\curlpp\option.hpp(147): note: see reference to class template instantiation 'curlpp::Option' being compiled
1> with
1> [
1> OptionType=std::string
1> ]
1>c:\users\josep\source\repos\testcurl\testcurl\testcurl.cpp(22): note: see reference to class template instantiation 'curlpp::OptionTraitstd::string,CURLOPT_URL' being compiled
1>Done building project "TestCurl.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

It seem's you are trying to use curpp as a dynamic library (.dll), please try to use it as static library first (.lib).
Or better, as you just want to build example22.cpp for now, build all curlpp in the main (.exe) application.