You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
Ran command below
$ git clone [email protected]:meltwater/served.git
$ mkdir served.build && cd served.build
$ cmake ../served && make
create a file name a.cpp, whose content is
#include <served/served.hpp>
int main(int argc, char const* argv[]) {
// Create a multiplexer for handling requests
served::multiplexer mux;
// GET /hello
mux.handle("/hello")
.get([](served::response & res, const served::request & req) {
res << "Hello world!";
});
// Create the server and run with 10 handler threads.
served::net::server server("127.0.0.1", "8080", mux);
server.run(10);
return (EXIT_SUCCESS);
}
g++ a.cpp, got
a.cpp:1:10: fatal error: 'served/served.hpp' file not found
#include <served/served.hpp>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Where should I put a.cpp? Maybe it's because of the wrong file location..
The text was updated successfully, but these errors were encountered:
}
`
It works (linking succesful) but as soon as I uncomment the mux line this is occuring
Undefined symbols for architecture x86_64:
"served::multiplexer::multiplexer()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I also tried without served::
`
#include <served/served.hpp>
int main(int argc, const char * argv[]) {
multiplexer mux;
return (EXIT_SUCCESS);
}
`
which let me on the "error"
error: unknown type name 'multiplexer'; did you mean
'served::multiplexer'?
multiplexer mux;
^~~~~~~~~~~
served::multiplexer
/usr/local/include/served/multiplexer.hpp:53:7: note: 'served::multiplexer'
declared here
class multiplexer
that confirmed that the installation worked, since it could suggest automatically the right space name
So, what can I do ? is it because there is a missing option in my compiling process ?
I just compile with clang++ -std=c++17
thanks
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Have followed the instruction:
$ git clone [email protected]:meltwater/served.git
$ mkdir served.build && cd served.build
$ cmake ../served && make
#include <served/served.hpp>
int main(int argc, char const* argv[]) {
// Create a multiplexer for handling requests
served::multiplexer mux;
}
a.cpp:1:10: fatal error: 'served/served.hpp' file not found
#include <served/served.hpp>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Where should I put a.cpp? Maybe it's because of the wrong file location..
The text was updated successfully, but these errors were encountered: