darrengarvey / cgi

CGI and FastCGI C++ Library
http://cgi.sf.net
51 stars 32 forks source link

Windows Compilation Error #12

Closed TheAndreiM closed 5 years ago

TheAndreiM commented 8 years ago

Whenever I try to compile fcgi_hello_world on windows on Microsoft Visual Studios 2015 with boost libraries 1.59, I get the following error:

Severity Code Description Project File Line Warning C4005 'BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT': macro redefinition fcgi_hello_world c:\boost_1_59_0\boost\asio\detail\config.hpp 227 Error C2039 'next_layer': is not a member of 'boost::cgi::common::basic_connectionboost::cgi::common::tags::fcgi_transport' fcgi_hello_world c:\boost_1_59_0\boost\cgi\impl\fcgi_request_service.ipp 726 Error C2780 'size_t boost::asio::write(SyncWriteStream &,boost::asio::basic_streambuf &)': expects 2 arguments - 3 provided fcgi_hello_world c:\boost_1_59_0\boost\cgi\impl\fcgi_request_service.ipp 726 Error C2780 'size_t boost::asio::write(SyncWriteStream &,boost::asio::basic_streambuf &,CompletionCondition,boost::system::error_code &)': expects 4 arguments - 3 provided fcgi_hello_world c:\boost_1_59_0\boost\cgi\impl\fcgi_request_service.ipp 726 Error C2780 'size_t boost::asio::write(SyncWriteStream &,const ConstBufferSequence &)': expects 2 arguments - 3 provided fcgi_hello_world c:\boost_1_59_0\boost\cgi\impl\fcgi_request_service.ipp 726 Error C2780 'size_t boost::asio::write(SyncWriteStream &,const ConstBufferSequence &,CompletionCondition,boost::system::error_code &)': expects 4 arguments - 3 provided fcgi_hello_world c:\boost_1_59_0\boost\cgi\impl\fcgi_request_service.ipp 726

TheAndreiM commented 8 years ago

Line 507 in win32_acceptor_service_impl.hpp (acceptorservice.accept(impl.acceptor_, *newrequest->client().connection()->socket, &impl.endpoint_, ec);) errors out. I commented this line to get the error stated above.

aldot commented 5 years ago

i fixed some of those some time ago for linux FYI: https://github.com/darrengarvey/cgi/commit/6b28a0e563c21e090a2e9f712ace384d0c770e6e HTH

darrengarvey commented 5 years ago

Yep, thanks @aldot.

aldot commented 5 years ago

I only fixed it for linux, not for windows (can't test that). You probably have to switch your windows impl to use next_layer(), too. Maybe something like the attached? win32_acceptor_service_impl-use-next_layer.00.patch.txt