jgaa / restc-cpp

Modern C++ REST Client library
MIT License
615 stars 95 forks source link

issue in linking restc-cpp with a project on redhat 7 #81

Closed dheeraj12190 closed 5 years ago

dheeraj12190 commented 5 years ago

Hello Sir, I am using your library in my project. I am able to use it on ubuntu. I have successfully compiled your library on redhat7. but when I am linking to my project I am getting following error

restc-cpp.h:368: undefined reference to `restc_cpp::Context::Create(boost::asio::basic_yield_context<boost::asio::detail::wrapped_handler<boost::asio::io_service::strand, void (*)(), boost::asio::detail::is_continuation_if_running> >&, restc_cpp::RestClient&)'

Need your help to resolve the problem Thank You

jgaa commented 5 years ago

I have not tested restc_cpp on redhat.

What compiler version and boost library versions are you using?

dheeraj12190 commented 5 years ago

compiler version is 6.3 and boost version is 1.69.

dheeraj12190 commented 5 years ago

I have also used GCC version 7.3 and Boost_version 1.61 but still facing the same issue ./include/restc-cpp/include/restc-cpp/RequestBuilder.h:371: undefined reference to `restc_cpp::Request::Create(std::string const&, restc_cpp::Request::Type, restc_cpp::RestClient&, std::unique_ptr<restc_cpp::RequestBody, std::default_delete >, boost::optional<std::deque<restc_cpp::Request::Arg, std::allocator > > const&, boost::optional const&, boost::optional const&)' collect2: error: ld returned 1 exit status

jgaa commented 5 years ago

I will check it out later this week.

jgaa commented 5 years ago

I have tested with centos, and all the tests link and run. I used devtoolset-7-gcc and boost 1.69.0. Does the tests link on your system?

From the linker-message, it seems like you don't link the library to your project. Can you provide the full link command with all parameters?

dheeraj12190 commented 5 years ago

Now I am able to link on redhat 7. Issue was cmake was not linking with libdl.