0

All I wanted was a simple web server in C++ for both windows and Linux... well not that easy as I thought.

I wasn't able to find solution for get_io_service() which was changed after boost 1.70 release. I am trying to get work this project: https://github.com/eidheim/Simple-Web-Server

I did install boost 1.75, compiled b2 libraries. Linked headers and libraries with VS project, but then It still couldn't find some libs, so I had to use Visual studio NuGet manager to install boost-vc142 with version 1.71.

    std::unique_ptr<socket_type> socket;
    ... some function ...
    timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(socket->get_io_service()));

On the last line I have 2 errors. One with missing constructor, second with get_io_service() No member.

Severity    Code    Description Project File    Line    Suppression State
Error   C2512   'boost::asio::basic_waitable_timer<std::chrono::steady_clock,boost::asio::wait_traits<Clock>,boost::asio::executor>::basic_waitable_timer': no appropriate default constructor available

Severity    Code    Description Project File    Line    Suppression State
Error   C2039   'get_io_service': is not a member of 'boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::executor>'

I also tried to go for 1.69 version, but then NuGet installer saying he couldnt find 1.69 version... so I am little trapped.

I know there is a lot of examples of webservers, but I want to take some solution and use it stead developing whole server. Requirements are: listening to the specific port, solving GETs from web http, providing WEB page files which I want to edit separably. If someone has some app I would be very much appreciate it.

sehe
  • 374,641
  • 47
  • 450
  • 633
Jan Retych
  • 53
  • 8
  • The changes were quite trivial: https://github.com/sehe/Simple-Web-Server/commit/01df7fb17e1d1a870ac1a5dfc8e36a2de94f73f4 Can't PR because repo is frozen – sehe Mar 13 '21 at 16:27
  • I will try it tomorrow, thank you for now :) – Jan Retych Mar 14 '21 at 19:41

0 Answers0