Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Issues compiling hello world #73

Open
evanugarte opened this issue Oct 30, 2020 · 3 comments
Open

Issues compiling hello world #73

evanugarte opened this issue Oct 30, 2020 · 3 comments

Comments

@evanugarte
Copy link

evanugarte commented Oct 30, 2020

After running the install steps with cmake from the README's building steps, i am met with the below errors:

/usr/bin/ld: /tmp/ccb5Bytw.o: in function `main::{lambda(served::response&, served::request const&)#1}::operator()(served::response&, served::request const&) const':
main.cpp:(.text+0x76): undefined reference to `served::response::operator<<(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /tmp/ccb5Bytw.o: in function `main':
main.cpp:(.text+0x11a): undefined reference to `served::multiplexer::multiplexer()'
/usr/bin/ld: main.cpp:(.text+0x192): undefined reference to `served::multiplexer::handle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/bin/ld: main.cpp:(.text+0x1b6): undefined reference to `served::methods_handler::get(std::function<void (served::response&, served::request const&)>)'
/usr/bin/ld: main.cpp:(.text+0x2d3): undefined reference to `served::net::server::server(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, served::multiplexer&, bool)'
/usr/bin/ld: main.cpp:(.text+0x328): undefined reference to `served::net::server::run(int, bool)'
/usr/bin/ld: /tmp/ccb5Bytw.o: in function `served::net::server::~server()':
main.cpp:(.text._ZN6served3net6serverD2Ev[_ZN6served3net6serverD5Ev]+0x2e): undefined reference to `served::net::connection_manager::~connection_manager()'
collect2: error: ld returned 1 exit status

seems like it is a linker error? i am compiling with g++ -std=c++11 main.cpp -Iinclude -Iserved/src/served -lboost_system -lpthread from the directory i cloned the served project into.

i will try building with blaze tomorrow to see if this resolves it

@dominique120
Copy link

Dont forget to link against libserved. To have it you must build and install served. Also for some reason my application did not start so I had to do this as well:

ln /usr/local/lib/libserved.so.1.4 /usr/lib64/libserved.so.1.4

@MrBeanc
Copy link

MrBeanc commented Nov 10, 2020

I encountered the same problem when compiling. Can you provide us with a standard compilation format。
i am compiling with clang++-9 a.cpp -std=c++11 -lboost_system

@dominique120
Copy link

Dont forget that you must build and install served. Once you have done that you must link against libserved.so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants