Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic example in README.md does not compile. #19

Open
NAThompson opened this issue Apr 7, 2019 · 2 comments
Open

Basic example in README.md does not compile. #19

NAThompson opened this issue Apr 7, 2019 · 2 comments

Comments

@NAThompson
Copy link

NAThompson commented Apr 7, 2019

The first example in the USAGE section of the README.md does not compile. To wit, it is not clear which files must be #include'd in order to get it t run. After cycling through quite a different number of compile errors and header combinations, I got stuck here:

BeastHttp$ g++ --std=c++14 -Wfatal-errors -I./include -I../moetsi/dependencies/boost server.cpp -o runserver
In file included from server.cpp:6:0:
./include/reactor/listener.hxx:102:32: error: type/value mismatch at argument 4 in template parameter list for ‘template<template<class> class OnAccept, template<class> class OnError, class Protocol, template<class> class Acceptor, template<class> class Socket, template<class> class Endpoint> class _0xdead4ead::http::reactor::listener’
 using listener_type = listener<>;
                                  ^

where server.cpp consists of

#include <iostream>
#include <base/cb.hxx>
#include <base/regex.hxx>
#include <base/request_processor.hxx>
#include <reactor/listener.hxx>
#include <reactor/session.hxx>
#include <basic_router.hxx>
#include <out.hxx>
#include <boost/asio/posix/stream_descriptor.hpp>
#include <boost/asio/signal_set.hpp>
#include <thread>
#include <param.hxx>
#include <basic_router.hxx>
#include <chain_router.hxx>
#include <literals.hxx>
#include <boost/beast/http.hpp>

using namespace _0xdead4ead;

using HttpSession = http::reactor::_default::session_type;
using HttpListener = http::reactor::_default::listener_type;


int main()
{
    http::basic_router<HttpSession> router;

    router.get("^/$", [](auto request, auto context) {
        context.send(make_response(request, "MAIN PAGE\n"));
    });
}

I got a little closer by #include <unordered_map> in session.hxx, but still didn't get it to go through.

@0xdead4ead
Copy link
Owner

You looked code examples?

@NAThompson
Copy link
Author

Yes.

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

No branches or pull requests

2 participants