zaphoyd / websocketpp

C++ websocket client/server library
http://www.zaphoyd.com/websocketpp
Other
6.99k stars 1.97k forks source link

chat server example does not compile #74

Closed muhler closed 12 years ago

muhler commented 12 years ago

The file examples/chat_server has the following include

include "../../src/interfaces/session.hpp".

Yet, the session.hpp is now present in the directory src/legacy/interfaces.

Furhtermore legacy/interfaces/session.hpp includes non-existing websocket_constants.hpp

muhler commented 12 years ago

Applies also to echo_server and echo_server_tls examples.

zaphoyd commented 12 years ago

the chat server example has been updated to the latest API now. The echo servers should have already been fine. I have removed some unused files from the echo server example that did include calls to the old API. chat_client is now the only example that hasn't been updated. I'll get that one working this weekend. Let me know if you still have trouble running any of the server examples. Nothing should be using code in the /legacy/ folder.

muhler commented 12 years ago

Am 24.02.2012 15:07, schrieb Peter Thorson:

the chat server example has been updated to the latest API now. The echo servers should have already been fine. I have removed some unused files from the echo server example that did include calls to the old API. chat_client is now the only example that hasn't been updated. I'll get that one working this weekend. Let me know if you still have trouble running any of the server examples. Nothing should be using code in the /legacy/ folder.


Reply to this email directly or view it on GitHub: https://github.com/zaphoyd/websocketpp/issues/74#issuecomment-4157279

Hi Peter,

that's great, I will try the chat server example tonight.

best regards Michael

muhler commented 12 years ago

Compiles without a problem on debian testing (wheezy) using boost 1.48. I just had to change BOOST_LIB_PATH and BOOST_INCLUDE_PATH variables within the Makefile. Thanks.

zaphoyd commented 12 years ago

excellent. FYI, you can set the appropriate values on the command line as well if you don't want to edit the makefile. make BOOST_LIB_PATH=~/my/custom/boost/path BOOST_INCLUDE_PATH=/.../

mhchen124 commented 12 years ago

Hi Zaphoyd:

I downloaded the Windows impl (for VS 2010) and had quite some problem getting it compiled -- first it still depend on files in legacy folder. I copied them back one level up so that got resolved. Then it claimed "missing file of ../websocket_constants.hpp" and no where can I find it in the downloaded project. Plus many errors output from the compiler (see below). Please advise what I did wrong here, or did I missed out something?

Thanks in advance.

Michael

==================== build output ===================

1>------ Build started: Project: websocketpp, Configuration: Debug Win32 ------ 1> websocket_server_session.cpp 1>c:\work\zaphoyd-websocketpp\src\interfaces\session.hpp(36): fatal error C1083: Cannot open include file: '../websocket_constants.hpp': No such file or directory 1> websocket_client_session.cpp 1>c:\work\zaphoyd-websocketpp\src\interfaces\session.hpp(36): fatal error C1083: Cannot open include file: '../websocket_constants.hpp': No such file or directory 1> websocket_client.cpp 1>c:\work\zaphoyd-websocketpp\src\interfaces\session.hpp(36): fatal error C1083: Cannot open include file: '../websocket_constants.hpp': No such file or directory 1> Generating Code... 2>------ Build started: Project: chatclient, Configuration: Debug Win32 ------ 3>------ Build started: Project: chatserver, Configuration: Debug Win32 ------ 4>------ Build started: Project: echoserver, Configuration: Debug Win32 ------ 5>------ Build started: Project: echoclient, Configuration: Debug Win32 ------ 3> chat_server.cpp 2> chat_client_handler.cpp 4> echo_server.cpp 5> echo_client_handler.cpp 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(50): error C2039: 'session_ptr' : is not a member of 'websocketpp' 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(50): error C2873: 'session_ptr' : symbol cannot be used in a using-declaration 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(54): error C2955: 'websocketpp::connection_handler' : use of class template requires template argument list 2> c:\work\zaphoyd-websocketpp\examples\chat_client../../src/websocket_connection_handler.hpp(39) : see declaration of 'websocketpp::connection_handler' 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(56): error C2512: 'websocketpp::connection_handler' : no appropriate default constructor available 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(56): error C2512: 'boost::shared_ptr' : no appropriate default constructor available 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(57): error C2039: '{dtor}' : is not a member of 'websocketpp::connection_handler' 2> c:\work\zaphoyd-websocketpp\examples\chat_client../../src/websocket_connection_handler.hpp(39) : see declaration of 'websocketpp::connection_handler' 2>......\examples\chat_client\chat_client_handler.cpp(33): error C2039: 'client_session_ptr' : is not a member of 'websocketpp' 2>......\examples\chat_client\chat_client_handler.cpp(33): error C2873: 'client_session_ptr' : symbol cannot be used in a using-declaration 2>......\examples\chat_client\chat_client_handler.cpp(45): error C3861: 'client_session_ptr': identifier not found 2>......\examples\chat_client\chat_client_handler.cpp(65): error C2839: invalid return type 'T ' for overloaded 'operator ->' 2>......\examples\chat_client\chat_client_handler.cpp(65): error C2039: 'io_service' : is not a member of 'boost::shared_ptr' 2>......\examples\chat_client\chat_client_handler.cpp(65): error C2228: left of '.post' must have class/struct/union 2>......\examples\chat_client\chat_client_handler.cpp(73): error C2839: invalid return type 'T ' for overloaded 'operator ->' 2>......\examples\chat_client\chat_client_handler.cpp(73): error C2039: 'io_service' : is not a member of 'boost::shared_ptr' 2>......\examples\chat_client\chat_client_handler.cpp(73): error C2228: left of '.post' must have class/struct/union 3>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2977: 'websocketpp::role::server::connection' : too many template arguments 3> with 2>......\examples\chat_client\chat_client_handler.cpp(90): error C2839: invalid return type 'T ' for overloaded 'operator ->' 2>......\examples\chat_client\chat_client_handler.cpp(90): error C2039: 'send' : is not a member of 'boost::shared_ptr' 2>......\examples\chat_client\chat_client_handler.cpp(99): error C2839: invalid return type 'T ' for overloaded 'operator ->' 2>......\examples\chat_client\chat_client_handler.cpp(99): error C2039: 'close' : is not a member of 'boost::shared_ptr' 2>......\examples\chat_client\chat_client_handler.cpp(99): error C2039: 'CLOSE_STATUS_GOING_AWAY' : is not a member of 'websocketpp::session' 2>......\examples\chat_client\chat_client_handler.cpp(99): error C2065: 'CLOSE_STATUS_GOING_AWAY' : undeclared identifier 3> [ 3> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 3> ] 3> c:\work\zaphoyd-websocketpp\src\roles/server.hpp(59) : see declaration of 'websocketpp::role::server::connection' 3> with 3> [ 3> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 3> ] 3> c:\work\zaphoyd-websocketpp\examples\chat_server\chat.hpp(51) : see reference to class template instantiation 'websocketpp::endpoint<role,socket>' being compiled 3> with 3> [ 3> role=websocketpp::role::server, 3> socket=websocketpp::socket::plain 3> ] 3>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2385: ambiguous access of 'connection' 3> could be the 'connection' in base 'websocketpp::role::serverwebsocketpp::endpoint<websocketpp::role::server,websocketpp::socket::plain,websocketpp::log::logger >' 3> or could be the 'connection' in base 'websocketpp::socket::plainwebsocketpp::endpoint<websocketpp::role::server,websocketpp::socket::plain,websocketpp::log::logger >' 3>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2990: 'websocketpp::role::server::connection' : non-class template has already been declared as a class template 3> with 3> [ 3> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 3> ] 3> c:\work\zaphoyd-websocketpp\src\roles/server.hpp(59) : see declaration of 'websocketpp::role::server::connection' 3> with 3> [ 3> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 3> ] 2> chat_client.cpp 4>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2977: 'websocketpp::role::server::connection' : too many template arguments 4> with 4> [ 4> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 4> ] 4> c:\work\zaphoyd-websocketpp\src\roles/server.hpp(59) : see declaration of 'websocketpp::role::server::connection' 4> with 4> [ 4> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 4> ] 4> ......\examples\echo_server\echo_server.cpp(34) : see reference to class template instantiation 'websocketpp::endpoint<role,socket>' being compiled 4> with 4> [ 4> role=websocketpp::role::server, 4> socket=websocketpp::socket::plain 4> ] 4>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2385: ambiguous access of 'connection' 4> could be the 'connection' in base 'websocketpp::role::serverwebsocketpp::endpoint<websocketpp::role::server,websocketpp::socket::plain,websocketpp::log::logger >' 4> or could be the 'connection' in base 'websocketpp::socket::plainwebsocketpp::endpoint<websocketpp::role::server,websocketpp::socket::plain,websocketpp::log::logger >' 4>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2990: 'websocketpp::role::server::connection' : non-class template has already been declared as a class template 4> with 4> [ 4> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 4> ] 4> c:\work\zaphoyd-websocketpp\src\roles/server.hpp(59) : see declaration of 'websocketpp::role::server::connection' 4> with 4> [ 4> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 4> ] 3> chat.cpp 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.hpp(52): error C2955: 'websocketpp::connection_handler' : use of class template requires template argument list 5> c:\work\zaphoyd-websocketpp\src\websocket_connection_handler.hpp(39) : see declaration of 'websocketpp::connection_handler' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.hpp(52): error C2955: 'websocketpp::connection_handler' : use of class template requires template argument list 5> c:\work\zaphoyd-websocketpp\src\websocket_connection_handler.hpp(39) : see declaration of 'websocketpp::connection_handler' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.hpp(54): error C2512: 'websocketpp::connection_handler' : no appropriate default constructor available 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.hpp(55): error C2039: '{dtor}' : is not a member of 'websocketpp::connection_handler' 5> c:\work\zaphoyd-websocketpp\src\websocket_connection_handler.hpp(39) : see declaration of 'websocketpp::connection_handler' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(34): error C2039: 'client_session_ptr' : is not a member of 'websocketpp' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(34): error C2873: 'client_session_ptr' : symbol cannot be used in a using-declaration 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(37): error C2839: invalid return type 'T ' for overloaded 'operator ->' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(37): error C2039: 'get_resource' : is not a member of 'boost::shared_ptr' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(45): error C2839: invalid return type 'T ' for overloaded 'operator ->' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(45): error C2039: 'get_resource' : is not a member of 'boost::shared_ptr' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(49): error C2839: invalid return type 'T ' for overloaded 'operator ->' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(49): error C2039: 'send' : is not a member of 'boost::shared_ptr' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(55): error C2839: invalid return type 'T ' for overloaded 'operator ->' 5>c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client_handler.cpp(55): error C2039: 'send' : is not a member of 'boost::shared_ptr' 5> echo_client.cpp 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(50): error C2039: 'session_ptr' : is not a member of 'websocketpp' 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(50): error C2873: 'session_ptr' : symbol cannot be used in a using-declaration 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(54): error C2955: 'websocketpp::connection_handler' : use of class template requires template argument list 2> c:\work\zaphoyd-websocketpp\examples\chat_client../../src/websocket_connection_handler.hpp(39) : see declaration of 'websocketpp::connection_handler' 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(56): error C2512: 'websocketpp::connection_handler' : no appropriate default constructor available 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(56): error C2512: 'boost::shared_ptr' : no appropriate default constructor available 2>c:\work\zaphoyd-websocketpp\examples\chat_client\chat_client_handler.hpp(57): error C2039: '{dtor}' : is not a member of 'websocketpp::connection_handler' 2> c:\work\zaphoyd-websocketpp\examples\chat_client../../src/websocket_connection_handler.hpp(39) : see declaration of 'websocketpp::connection_handler' 3>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2977: 'websocketpp::role::server::connection' : too many template arguments 3> with 3> [ 3> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 3> ] 3> c:\work\zaphoyd-websocketpp\src\roles/server.hpp(59) : see declaration of 'websocketpp::role::server::connection' 3> with 3> [ 3> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 3> ] 3> c:\work\zaphoyd-websocketpp\examples\chat_server\chat.hpp(51) : see reference to class template instantiation 'websocketpp::endpoint<role,socket>' being compiled 3> with 3> [ 3> role=websocketpp::role::server, 3> socket=websocketpp::socket::plain 3> ] 3>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2385: ambiguous access of 'connection' 3> could be the 'connection' in base 'websocketpp::role::serverwebsocketpp::endpoint<websocketpp::role::server,websocketpp::socket::plain,websocketpp::log::logger >' 3> or could be the 'connection' in base 'websocketpp::socket::plainwebsocketpp::endpoint<websocketpp::role::server,websocketpp::socket::plain,websocketpp::log::logger >' 3>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2990: 'websocketpp::role::server::connection' : non-class template has already been declared as a class template 3> with 3> [ 3> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 3> ] 3> c:\work\zaphoyd-websocketpp\src\roles/server.hpp(59) : see declaration of 'websocketpp::role::server::connection' 3> with 3> [ 3> endpoint=websocketpp::endpointwebsocketpp::role::server,websocketpp::socket::plain 3> ] 3> Generating Code... 2>......\examples\chat_client\chat_client.cpp(54): error C2039: 'client_ptr' : is not a member of 'websocketpp' 2>......\examples\chat_client\chat_client.cpp(54): error C2065: 'client_ptr' : undeclared identifier 2>......\examples\chat_client\chat_client.cpp(54): error C2146: syntax error : missing ';' before identifier 'client' 2>......\examples\chat_client\chat_client.cpp(54): error C2039: 'client' : is not a member of 'websocketpp' 2>......\examples\chat_client\chat_client.cpp(54): error C2061: syntax error : identifier 'client' 2>......\examples\chat_client\chat_client.cpp(54): error C2143: syntax error : missing ';' before ')' 2>......\examples\chat_client\chat_client.cpp(54): error C3861: 'client': identifier not found 2>......\examples\chat_client\chat_client.cpp(54): error C2143: syntax error : missing ';' before ')' 2>......\examples\chat_client\chat_client.cpp(56): error C2065: 'client' : undeclared identifier 2>......\examples\chat_client\chat_client.cpp(56): error C2227: left of '->init' must point to class/struct/union/generic type 2> type is ''unknown-type'' 2>......\examples\chat_client\chat_client.cpp(58): error C2065: 'client' : undeclared identifier 2>......\examples\chat_client\chat_client.cpp(58): error C2227: left of '->set_header' must point to class/struct/union/generic type 2> type is ''unknown-type'' 2>......\examples\chat_client\chat_client.cpp(59): error C2065: 'client' : undeclared identifier 2>......\examples\chat_client\chat_client.cpp(59): error C2227: left of '->add_subprotocol' must point to class/struct/union/generic type 2> type is ''unknown-type'' 2>......\examples\chat_client\chat_client.cpp(61): error C2065: 'client' : undeclared identifier 2>......\examples\chat_client\chat_client.cpp(61): error C2227: left of '->set_origin' must point to class/struct/union/generic type 2> type is ''unknown-type'' 2>......\examples\chat_client\chat_client.cpp(63): error C2065: 'client' : undeclared identifier 2>......\examples\chat_client\chat_client.cpp(63): error C2227: left of '->connect' must point to class/struct/union/generic type 2> type is ''unknown-type'' 2> Generating Code... 2>FileTracker : error FTK1011: could not create the new file tracking log file: C:\work\zaphoyd-websocketpp\windows\vcpp2010\examples\Debug\CL.read.1.tlog. The file exists. 2>
2>
2>
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(147,5): error MSB6003: The specified task executable "CL.exe" could not be run. The process cannot access the file 'C:\work\zaphoyd-websocketpp\windows\vcpp2010\examples\Debug\cl.read.1.tlog' because it is being used by another process. 5>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2977: 'websocketpp::role::client::connection' : too many template arguments 5> with 5> [ 5> endpoint=websocketpp::endpointwebsocketpp::role::client,websocketpp::socket::plain 5> ] 5> c:\work\zaphoyd-websocketpp\src\roles\client.hpp(58) : see declaration of 'websocketpp::role::client::connection' 5> with 5> [ 5> endpoint=websocketpp::endpointwebsocketpp::role::client,websocketpp::socket::plain 5> ] 5> c:\work\zaphoyd-websocketpp\examples\echo_client\echo_client.cpp(35) : see reference to class template instantiation 'websocketpp::endpoint<role,socket>' being compiled 5> with 5> [ 5> role=websocketpp::role::client, 5> socket=websocketpp::socket::plain 5> ] 5>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2385: ambiguous access of 'connection' 5> could be the 'connection' in base 'websocketpp::role::clientwebsocketpp::endpoint<websocketpp::role::client,websocketpp::socket::plain,websocketpp::log::logger >' 5> or could be the 'connection' in base 'websocketpp::socket::plainwebsocketpp::endpoint<websocketpp::role::client,websocketpp::socket::plain,websocketpp::log::logger >' 5>c:\work\zaphoyd-websocketpp\src\endpoint.hpp(111): error C2990: 'websocketpp::role::client::connection' : non-class template has already been declared as a class template 5> with 5> [ 5> endpoint=websocketpp::endpointwebsocketpp::role::client,websocketpp::socket::plain 5> ] 5> c:\work\zaphoyd-websocketpp\src\roles\client.hpp(58) : see declaration of 'websocketpp::role::client::connection' 5> with 5> [ 5> endpoint=websocketpp::endpointwebsocketpp::role::client,websocketpp::socket::plain 5> ] 5> Generating Code... ========== Build: 0 succeeded, 5 failed, 0 up-to-date, 0 skipped ==========

zaphoyd commented 12 years ago

The VCPP projects are not presently well maintained. I don't have good access to a windows development environment. I am currently working on a cross platform build system to replace the existing unix makefiles and adhoc xcode/vcpp projects. Once this is complete I'll get rid of the master branch and all the legacy files. In the meantime, the VCPP project for chat_server may be out of date, feel free to update it based on information in the unix makefile (which is current for chat_server on the policy refactor branch).

zaphoyd commented 12 years ago

chat_server example should fully work now on unix. The new scons based build system will support chat_server soon and support building on windows natively.