drogon
drogon copied to clipboard
simple_reverse_proxy build error
I added simple_reverse_proxy to CMakeLists.txt, but it got following building error:
drogon/examples/simple_reverse_proxy/plugins/SimpleReverseProxy.cc:42:60: error: unused parameter ‘ioLoopIndex’ [-Werror=unused-parameter] 42 | [this](std::vector<HttpClientPtr> &clients, size_t ioLoopIndex) { |
Branch: master Build host: ubuntu 20.04
What could I be missing?
thank you
Unfortunately I don’t have the time to investigate this issue further, but it looks like some recent changes were introduced that make the compiler more aggressive as I get similar errors about unused values on macOS Monterey with Trantor:
/tmp/drogon-20231110-7398-qzdq7n/trantor/trantor/utils/Logger.cc:396:5: error: expression result unused [-Werror,-Wunused-value]
(bool)logger;
^ ~~~~~~
1 error generated.
PR #1839 may be the culprit.
Fixed it. @An Tao, I presume you did not intend to assign the ioLoopIndex in that lambda call, remove the ioLoopIndex fixed the build. In general for similar errors, if a variable is not used, to remove it should fix the build. Thank you