Open philave opened 8 years ago
please use vs2015 crow use multi c++11 grammars!
Yes gggin you are right. Finally, I succeeded to build crow sample only with VS2015 and Boost 1.58
Even the latest previous version of VS (2013 Update 5) won’t compile the sample code above. With VS2013 problem occurs not in crow_all.h itself, but in Boost headers. Actually, VS2013 can build crow with older versions of Boost (e.g. Boost 1.52).
PS Maybe it would be better to mention VS2015 requirement in project Wiki
JetBrains CLion 2017.1.3 + MinGW how build the project?
Here is the compile error
"E:\CLion 2017.1.3\bin\cmake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\sa\Desktop\crow-master
-- Not Found Tcmalloc: Tcmalloc_LIBRARY-NOTFOUND
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
CMake Warning at E:/CLion 2017.1.3/bin/cmake/share/cmake-3.7/Modules/FindBoost.cmake:761 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
E:/CLion 2017.1.3/bin/cmake/share/cmake-3.7/Modules/FindBoost.cmake:865 (_Boost_COMPONENT_DEPENDENCIES)
E:/CLion 2017.1.3/bin/cmake/share/cmake-3.7/Modules/FindBoost.cmake:1454 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:22 (find_package)
CMake Warning at E:/CLion 2017.1.3/bin/cmake/share/cmake-3.7/Modules/FindBoost.cmake:761 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
E:/CLion 2017.1.3/bin/cmake/share/cmake-3.7/Modules/FindBoost.cmake:865 (_Boost_COMPONENT_DEPENDENCIES)
E:/CLion 2017.1.3/bin/cmake/share/cmake-3.7/Modules/FindBoost.cmake:1454 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:22 (find_package)
CMake Error at E:/CLion 2017.1.3/bin/cmake/share/cmake-3.7/Modules/FindBoost.cmake:1812 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
CMakeLists.txt:22 (find_package)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
used as include directory in directory C:/Users/sa/Desktop/crow-master
used as include directory in directory C:/Users/sa/Desktop/crow-master
used as include directory in directory C:/Users/sa/Desktop/crow-master
used as include directory in directory C:/Users/sa/Desktop/crow-master
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/examples
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests/template
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests/template
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests/template
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests/template
used as include directory in directory C:/Users/sa/Desktop/crow-master/tests/template
-- Configuring incomplete, errors occurred!
See also "C:/Users/sa/Desktop/crow-master/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "C:/Users/sa/Desktop/crow-master/cmake-build-debug/CMakeFiles/CMakeError.log".
I think I am having the same issue using Dev C++ 5.11 and boost 1.68.0...
10 0 D:\GitHub\crow\include\crow.h In file included from D:\GitHub\crow\include/crow.h
1 D:\GitHub\C++Test\test.cpp from D:\GitHub\C++Test\test.cpp
D:\GitHub\crow\include\crow\logging.h In static member function 'static std::string crow::logger::timestamp()':
55 36 D:\GitHub\crow\include\crow\logging.h [Error] 'gmtime_s' was not declared in this scope
22 0 D:\GitHub\crow\include\crow.h In file included from D:\GitHub\crow\include/crow.h
1 D:\GitHub\C++Test\test.cpp from D:\GitHub\C++Test\test.cpp
D:\GitHub\crow\include\crow\http_server.h In lambda function:
86 62 D:\GitHub\crow\include\crow\http_server.h [Error] there are no arguments to 'gmtime_s' that depend on a template parameter, so a declaration of 'gmtime_s' must be available [-fpermissive]
86 62 D:\GitHub\crow\include\crow\http_server.h [Note] (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
D:\GitHub\crow\include\crow\http_server.h In instantiation of 'crow::Server<Handler, Adaptor, Middlewares>::run()::<lambda()>::<lambda()> [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]':
90 33 D:\GitHub\crow\include\crow\http_server.h required from 'struct crow::Server<Handler, Adaptor, Middlewares>::run()::<lambda()> [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]::<lambda()>'
93 29 D:\GitHub\crow\include\crow\http_server.h required from 'crow::Server<Handler, Adaptor, Middlewares>::run()::<lambda()> [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]'
74 67 D:\GitHub\crow\include\crow\http_server.h required from 'struct crow::Server<Handler, Adaptor, Middlewares>::run() [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]::<lambda()>'
138 26 D:\GitHub\crow\include\crow\http_server.h required from 'void crow::Server<Handler, Adaptor, Middlewares>::run() [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]'
123 17 D:\GitHub\crow\include\crow\app.h required from 'void crow::Crow<Middlewares>::run() [with Middlewares = {}]'
11 41 D:\GitHub\C++Test\test.cpp required from here
86 62 D:\GitHub\crow\include\crow\http_server.h [Error] 'gmtime_s' was not declared in this scope
2225 D:\Programs\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\functional confused by earlier errors, bailing out
I’m trying just to build sample from Wiki:
First method – VS 2013 (VC++ version: 18.00.21005.1 for x86)
I get the following compilation error:
Ok may be VC++ compiler is incompatible with some C++ features used in the project. Let’s try GCC environment.
Second method MinGW-w64 (version: 6.2.0 platform: x86_64-w64-mingw32)
Compilation error:
First error occurs because
gmtime_s/gmtime_r
functions are not defined in c/c++ standard headers. This problem can be solved by replacing the function withgmtime
wrapper.I don’t understand why the std::this_thread error occurred .
Has anyone managed to build the project on Windows? How?