[Linux] - error linker

Hi all,

I wrote web api application using cpprest following this guide
https://github.com/ivanmejiarocha/micro-service

I installed cpprest + boost + cmake + git + openssl on the Ubuntu machine

I'm trying to run this application on my Ubuntu machine using visual studio 2017 and linker failed.
here's the following output :


1>Validating architecture
1>Validating sources
1>Copying sources remotely to '192.168.9.48'
1>Starting remote build
1>Compiling sources:
1>basic_controller.cpp
1>Linking objects
1>/home/daniel/projects/cproject/obj/x86/Debug/basic_controller.o: In function `cfx::BasicController::~BasicController()':
1>/home/daniel/projects/cproject/basic_controller.cpp:36: undefined reference to `web::http::experimental::listener::http_listener::~http_listener()'
1>/home/daniel/projects/cproject/obj/x86/Debug/basic_controller.o: In function `cfx::BasicController::setEndpoint(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
1>/home/daniel/projects/cproject/basic_controller.cpp:41: undefined reference to `web::uri::uri(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
1>/home/daniel/projects/cproject/basic_controller.cpp:54: undefined reference to `web::uri_builder::to_uri()'
1>/home/daniel/projects/cproject/basic_controller.cpp:54: undefined reference to `web::http::experimental::listener::http_listener::~http_listener()'
1>/home/daniel/projects/cproject/obj/x86/Debug/basic_controller.o: In function `cfx::BasicController::requestPath[abi:cxx11](web::http::http_request const&)':
1>/home/daniel/projects/cproject/basic_controller.cpp:71: undefined reference to `web::uri::decode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
1>/home/daniel/projects/cproject/basic_controller.cpp:72: undefined reference to `web::uri::split_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
1>/home/daniel/projects/cproject/obj/x86/Debug/basic_controller.o: In function `__static_initialization_and_destruction_0(int, int)':
1>/usr/include/boost/system/error_code.hpp:221: undefined reference to `boost::system::generic_category()'
1>/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
1>/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::system_category()'
Last edited on
closed account (E0p9LyTq)
@Daniel5053,

I use VS 2017 on a Windows machine, so the advice might not be as complete as we'd like.

The error looks like you didn't set the root Boost directory in your project settings.

If it were Windows the setting would be at the project's C/C++ property page, General, Additional Include Directories.

I wish I could be more helpful.

BTW, are you running Visual Studio Code 2017 natively on your Ubuntu machine, or Visual Studio 2017 in a Windows emulator? It does make quite a difference.
@Daniel5053,

Have you checked this ticket?

https://github.com/ivanmejiarocha/micro-service/issues/1

it might provide some light on this.

Thanks,
Ivan.
Topic archived. No new replies allowed.