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

[Bug?] Running websocket example doesn't work #774

Closed
therockf opened this issue Feb 27, 2024 · 2 comments
Closed

[Bug?] Running websocket example doesn't work #774

therockf opened this issue Feb 27, 2024 · 2 comments
Labels
further information required existing information is lacking, or feedback is required question Issue can be closed by providing information

Comments

@therockf
Copy link

therockf commented Feb 27, 2024

Hello i am trying to run the websocket server from the examples but i have this error

https://github.com/CrowCpp/Crow/blob/master/examples/websocket/example_ws.cpp

/main.cpp:44:5: error: ‘CROW_WEBSOCKET_ROUTE’ was not declared in this scope
   44 |     CROW_WEBSOCKET_ROUTE(app, "/ws")
      |     ^~~~~~~~~~~~~~~~~~~~
@junekhan
Copy link
Contributor

I have no problem building this example from the latest master branch. Did you set up you project from the CMAKEFILE

[build] Scanning dependencies of target example_websocket
[build] [ 50%] Building CXX object examples/CMakeFiles/example_websocket.dir/websocket/example_ws.cpp.o
[build] In file included from /workspaces/Crow/include/crow.h:8,
[build]                  from /workspaces/Crow/examples/websocket/example_ws.cpp:1:
[build] /workspaces/Crow/include/crow/json.h: In function 'void crow::json::escape(const string&, std::string&)':
[build] /workspaces/Crow/include/crow/json.h:52:31: warning: comparison is always true due to limited range of data type [-Wtype-limits]
[build]    52 |                         if (c >= 0 && c < 0x20)
[build]       |                             ~~^~~~
[build] [100%] Linking CXX executable example_websocket
[build] [100%] Built target example_websocket

@gittiver gittiver added question Issue can be closed by providing information discussion The viability / implementation of the issue is up for debate labels Feb 28, 2024
@gittiver
Copy link
Member

We need information about how you build the example, as we can not reproduce the error.
Please provide these informations, if not this issue will be closed in two weeks.

@gittiver gittiver added further information required existing information is lacking, or feedback is required and removed discussion The viability / implementation of the issue is up for debate labels Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
further information required existing information is lacking, or feedback is required question Issue can be closed by providing information
Projects
None yet
Development

No branches or pull requests

3 participants