Stiffstream / restinio

Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library with the right balance between performance and ease of use
Other
1.15k stars 93 forks source link

error C2039: 'http_method_id_t': is not a member of 'restinio' building *_bench tests #31

Closed ahmedyarub closed 5 years ago

ahmedyarub commented 5 years ago

I'm on Windows 10 using CLion and Visual Studio 2019 compiler with CMake. Latest version of all of these tools. Here are my CMake flags:

-DCMAKE_TOOLCHAIN_FILE=D:/cpp/vcpkg/scripts/buildsystems/vcpkg.cmake -DRESTINIO_INSTALL=ON -DRESTINIO_TEST=ON -DRESTINIO_SAMPLE=ON -DRESTINIO_INSTALL_SAMPLES=ON -DRESTINIO_BENCH=ON -DRESTINIO_INSTALL_BENCHES=ON -DRESTINIO_FIND_DEPS=OFF

All the dependencies were downloaded using WSL since Mxx_ru kept on giving weird errors both on Windows CMD and MSYS.

Now I could build all the of the modules, run the samples and even create projects based on Restinio. But there are three specific targets:

add_subdirectory(express_router_pcre_bench)
add_subdirectory(express_router_pcre2_bench)
add_subdirectory(express_router_boost_regex_bench)

That I cannot build. They give the following errors:

D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(83): error C2039: 'http_method_id_t': is not a member of 'restinio' D:\cpp\vcpkg\installed\x64-windows\include\restinio/router/pcre_regex_engine.hpp(17): note: see declaration of 'restinio' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(83): error C3646: 'm_method': unknown override specifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(83): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(111): error C2039: 'http_method_id_t': is not a member of 'restinio' D:\cpp\vcpkg\installed\x64-windows\include\restinio/router/pcre_regex_engine.hpp(17): note: see declaration of 'restinio' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(111): error C2065: 'http_method_id_t': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(111): error C2146: syntax error: missing ';' before identifier 'mm' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(111): error C2065: 'mm': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(112): error C2039: 'http_method_id_t': is not a member of 'restinio' D:\cpp\vcpkg\installed\x64-windows\include\restinio/router/pcre_regex_engine.hpp(17): note: see declaration of 'restinio' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(112): error C2065: 'http_method_id_t': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(112): error C2146: syntax error: missing ';' before identifier 'method' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(112): error C2065: 'method': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(114): error C2065: 'mm': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(114): error C2039: 'default_http_methods_t': is not a member of 'restinio' D:\cpp\vcpkg\installed\x64-windows\include\restinio/router/pcre_regex_engine.hpp(17): note: see declaration of 'restinio' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(114): error C3083: 'default_http_methods_t': the symbol to the left of a '::' must be a type D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(114): error C2039: 'from_nodejs': is not a member of 'restinio' D:\cpp\vcpkg\installed\x64-windows\include\restinio/router/pcre_regex_engine.hpp(17): note: see declaration of 'restinio' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(114): error C3861: 'from_nodejs': identifier not found D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(117): error C2065: 'mm': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(119): error C2065: 'method': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(119): error C2065: 'mm': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(124): error C2065: 'method': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(129): error C2039: 'm_method': is not a member of 'route_line_t' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(81): note: see declaration of 'route_line_t' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(129): error C2065: 'method': undeclared identifier D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(152): error C2039: 'm_method': is not a member of 'route_line_t' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(81): note: see declaration of 'route_line_t' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(156): error C2039: 'm_method': is not a member of 'route_line_t' D:\cpp\restinio\dev\test\router\express_router_pcre_bench../express_router_bench/main.cpp(81): note: see declaration of 'route_line_t'

Any help would be appreciated.

eao197 commented 5 years ago

Hi!

It seems that you get benchmarks from the master branch on GitHub (or the default branch from BitBucket), but RESTinio itself is going from vcpkg. The problem is:

That is why you got compilation errors.

Try to use tagged version of RESTinio for benchmarks. For example, this one: https://github.com/Stiffstream/restinio/releases/tag/v.0.4.9.1

ahmedyarub commented 5 years ago

You are right I'll be just uninstalling the VCPKG version and building Restinio myself. That would help me em learning how does it work and how to measure its performance. Thank you very much for the prompt reply!