Skip to content

Loading…

Failed to compile example hello_world_client.cpp with MSVC 2005. #126

Closed
antoshagh opened this Issue · 4 comments

3 participants

@antoshagh

Dear developers,

I've just discovered your library.... and like the concept very much.
I've downloaded the latest version cpp-netlib-0.9.4.zip file.
I use boost library 1.49.0
OS: Windows XP
Compiler: MSVC 2005.

I've tried to compile example application hello_world_servercpp with the following command line:

D:\Prj\cpp-netlib-0.9.4\libs\network\example\http> cl -EHsc -D_WIN32_WINNT=0x0502 -I D:\Prj\cpp-netlib-0.9.4 -I D:\Prj\boost_1_49_0 hello_world_server.cpp

Compilation was successful.

Then I tried to compile example hello_world_client.cpp with the similar command line:

D:\Prj\cpp-netlib-0.9.4\libs\network\example\http> cl -EHsc -D_WIN32_WINNT=0x0502 -I D:\Prj\cpp-netlib-0.9.4 -I D:\Prj\boost_1_49_0 hello_world_client.cpp

As a result I've got the following output (see attached below) with a lot of compilation errors.

Could you please give an advice how to fix this?

Thanks in advance,
Anton.

/////////////////// Compilation errors of example hello_world_client.cpp //////
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

hello_world_client.cpp
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(25) : error C2065: 'M' : undeclared identifier
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/request_concept.hpp(72) : see reference to class template instantiation 'boost::network::Message<>' being compiled
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\boost_1_49_0\boost/concept/detail/has_constraints.hpp(42) : see reference to class template instantiation 'boost::network::http::ClientRequest' being compiled
with
[
R=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\boost_1_49_0\boost/concept/detail/msvc.hpp(53) : see reference to class template instantiation 'boost::concepts::not_satisfied' being compiled
with
[
Model=boost::network::http::ClientRequestboost::network::http::basic_request<boost::network::http::tags::http_async_8bit_udp_resolve>
]
D:\Prj\boost_1_49_0\boost/concept/requires.hpp(31) : see reference to class template instantiation 'boost::concepts::require' being compiled
with
[
Model=boost::network::http::ClientRequestboost::network::http::basic_request<boost::network::http::tags::http_async_8bit_udp_resolve>
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/connection/async_normal.hpp(83) : see reference to class template instantiation 'boost::requires' being compiled
with
[
ModelFn=void (__cdecl *)(boost::network::http::ClientRequestboost::network::http::basic_request<boost::network::http::tags::http_async_8bit_udp_resolve>)
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/connection/async_normal.hpp(79) : while compiling class template member function 'boost::network::http::basic_response boost::network::http::impl::http_async_connection::start(const boost::network::http::basic_request &,const std::basic_string<_Elem,_Traits,_Ax> &,bool,boost::function)'
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1,
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator,
Signature=void (const boost::iterator_range &,const boost::system::error_code &)
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/connection/async_base.hpp(46) : see reference to class template instantiation 'boost::network::http::impl::http_async_connection' being compiled
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/connection/async_base.hpp(40) : while compiling class template member function 'boost::shared_ptr boost::network::http::impl::async_connection_base::new_connection(boost::function,boost::asio::ip::basic_resolver &,bool,bool,boost::optionalstd::basic_string<_Elem,_Traits,_Ax>,const boost::optionalstd::basic_string<_Elem,_Traits,_Ax> &)'
with
[
T=boost::network::http::impl::async_connection_baseboost::network::http::tags::http_async_8bit_udp_resolve,1,1,
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1,
Signature=void (boost::asio::ip::basic_resolverboost::asio::ip::udp &,std::basic_string,std::allocator>,boost::uint16_t,boost::function,boost::asio::ip::basic_resolver_iteratorboost::asio::ip::udp>)>),
InternetProtocol=boost::asio::ip::udp,
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/policies/async_connection.hpp(49) : see reference to class template instantiation 'boost::network::http::impl::async_connection_base' being compiled
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/policies/async_connection.hpp(48) : while compiling class template member function 'boost::network::http::basic_response boost::network::http::async_connection_policy::connection_impl::send_request(const std::basic_string<_Elem,_Traits,_Ax> &,const boost::network::http::basic_request &,bool,boost::network::http::async_connection_policy::body_callback_function_type)'
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1,
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/async_impl.hpp(88) : see reference to class template instantiation 'boost::network::http::async_connection_policy::connection_impl' being compiled
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/async_impl.hpp(85) : while compiling class template member function 'const boost::network::http::basic_response boost::network::http::impl::async_client::request_skeleton(const boost::network::http::basic_request &,const std::basic_string<_Elem,_Traits,_Ax> &,bool,boost::network::http::impl::async_client::body_callback_function_type)'
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1,
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/pimpl.hpp(57) : see reference to class template instantiation 'boost::network::http::impl::async_client' being compiled
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/facade.hpp(147) : see reference to class template instantiation 'boost::network::http::basic_client_impl' being compiled
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client/facade.hpp(42) : see reference to function template instantiation 'void boost::network::http::basic_client_facade::init_pimpl(const ArgPack &,boost::network::http::basic_client_facade::no_io_service)' being compiled
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1,
ArgPack=boost::parameter::aux::empty_arg_list
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client.hpp(74) : see reference to function template instantiation 'boost::network::http::basic_client_facade::basic_client_facadeboost::parameter::aux::empty_arg_list(const ArgPack &)' being compiled
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1,
ArgPack=boost::parameter::aux::empty_arg_list
]
D:\Prj\cpp-netlib-0.9.4\boost/network/protocol/http/client.hpp(74) : while compiling class template member function'boost::network::http::basic_client::basic_client(void)'
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1
]
hello_world_client.cpp(31) : see reference to class template instantiation 'boost::network::http::basic_client' being compiled
with
[
Tag=boost::network::http::tags::http_async_8bit_udp_resolve,
version_major=1,
version_minor=1
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(25) : error C2955: 'boost::DefaultConstructible' : use of class template requires template argument list
D:\Prj\boost_1_49_0\boost/concept_check.hpp(131) : see declaration of 'boost::DefaultConstructible'
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(25) : error C2955: 'boost::CopyConstructible' : use of class template requires template argument list
D:\Prj\boost_1_49_0\boost/concept_check.hpp(161) : see declaration of 'boost::CopyConstructible'
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(25) : error C2955: 'boost::Assignable' : use of class template requires template argument list
D:\Prj\boost_1_49_0\boost/concept_check.hpp(139) : see declaration of 'boost::Assignable'
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(26) : error C2146: syntax error : missing ';' before identifier 'string_type'
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(26) : error C3254: 'boost::network::Message<>' : class contains explicit override 'string_type' but does not derive from an interface that contains the function declaration
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(26) : error C2838: 'string_type' : illegal qualified name in member declaration
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(26) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(26) : error C2602: 'boost::network::Message<>::string_type' is not a member of a base class of 'boost::network::Message<>'
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(26) : see declaration of 'boost::network::Message<>::string_type'
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(26) : error C2868: 'boost::network::Message<>::string_type' : illegal syntax for using-declaration; expected qualified-name
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(27) : error C2146: syntax error : missing ';' before identifier 'headers_container_type'
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(27) : error C3254: 'boost::network::Message<>' : class contains explicit override 'headers_container_type' but does not derive from an interface that contains the function declaration
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(27) : error C2838: 'headers_container_type' : illegal qualified name in member declaration
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(27) : error C2602: 'boost::network::Message<>::headers_container_type' is not a member of a base class of 'boost::network::Message<>'
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(27) : see declaration of 'boost::network::Message<>::headers_container_type'
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(27) : error C2868: 'boost::network::Message<>::headers_container_type' : illegal syntax for using-declaration; expected qualified-name
with
[
=boost::network::http::basic_requestboost::network::http::tags::http_async_8bit_udp_resolve
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(65) : error C2146: syntax error : missing ';' before identifier 'message'
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(65) : error C2208: 'boost::network::basic_message' :no members defined using this type
with
[
Tag=boost::network::tags::default_string
]
D:\Prj\cpp-netlib-0.9.4\boost/network/message/message_concept.hpp(65) : fatal error C1903: unable to recover from previous error(s); stopping compilation

@deanberris
C++ Network Library member
@antoshagh

Dear Dean,
Thanks for the quick reply.
No I didn't try to build the tests by CMake, since on http://cpp-netlib.github.com/ it is annouced as optional step.
Am I right?
I wanted only to try simple http client with simple http server.
I've got running http server in 5 minutes. And it really worked. Thanks to your library :-)
But I couldn' compile the hello_world_client.cpp..... That's why I included the full MSVC 2005 compiler output.
What is more.... Couple of minutes ago I've cut all additional lines from from hello_world_client.cpp and source for compilation now looks like this:

#include
int main(int argc, char *argv[]) {
boost::network::http::client client;
boost::network::http::client::request request(argv[1]);
client.get(request);
return 0;
}
This source code fails during compiling with exactly the same compiler output as an initial issue text.
If I comment one line:
client.get(request);
then compiling finishes successfully.
May this help to find the issue reason? What do you think?

Thanks in advance,
Anton.

@deanberris
C++ Network Library member
@glynos
C++ Network Library member

We no longer support compilers that don't implement the full set of C++11 features.

@glynos glynos closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.