restc-cpp icon indicating copy to clipboard operation
restc-cpp copied to clipboard

undefined reference to restc_cpp::RestClient::Create()

Open slage opened this issue 6 years ago • 2 comments

Hi, First of all, many thanks for your effort and work developing this library. I am trying to run one of example in a Linux Ubuntu environment but I am getting the error above while compiling. I have read many articles / google / examples but I couldn't figure out what I am doing wrong.

Environment: Visual Studio + WSL Ubuntu Visual Studio configured to C++14. int main() { auto rest_client = RestClient::Create();

// Call DoSomethingInteresting as a co-routine in a worker-thread.
rest_client->Process(DoSomethingInteresting);

// Wait for the coroutine to finish, then close the client.
rest_client->CloseWhenReady(true);

return 0;

}

slage avatar Jul 25 '19 18:07 slage

I have no experience with WSL. The project compiles with gcc and clang under Ubuntu, and visual studio for Windows.

jgaa avatar Jul 29 '19 10:07 jgaa

just did a git clone of the lib, cmake install to usr/local and tried first example from https://github.com/jgaa/restc-cpp/blob/master/doc/Tutorial.md I can second that auto rest_client = restc_cpp::RestClient::Create(); gives me undefined reference to restc_cpp::RestClient::Create()' /usr/local/include/restc-cpp/RequestBuilder.h:371: undefined reference to `restc_cpp::Request::Create(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, restc_cpp::Request::Type, restc_cpp::RestClient&, std::unique_ptr<restc_cpp::RequestBody, std::default_delete<restc_cpp::RequestBody> >, boost::optional<std::deque<restc_cpp::Request::Arg, std::allocator<restc_cpp::Request::Arg> > > const&, boost::optional<restc_cpp::Headers> const&, boost::optional<restc_cpp::Request::Auth> const&)'

`

demo.zip

cztk avatar Sep 29 '19 06:09 cztk