fkie / async_web_server_cpp

Asynchronous Web Server in C++
Other
5 stars 17 forks source link

Made the package work on windows 10 #1

Closed PranavDhulipala closed 3 years ago

PranavDhulipala commented 3 years ago

Fixed compilation errors caused while using MSVC.

roehling commented 3 years ago

I changed the code to make it look a little cleaner. Can you confirm that the code still builds from the ros1-develop branch?

PranavDhulipala commented 3 years ago

Hi @roehling the package fails to compile after the changes see below for the error

[3/6] Building CXX object async_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\src\websocket_message.cpp.obj
FAILED: async_web_server_cpp/CMakeFiles/async_web_server_cpp.dir/src/websocket_message.cpp.obj
C:\PROGRA~2\MICROS~4\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe  /nologo /TP -D-D_WIN32_WINNT=0x0A00 -DNOMINMAX -DROS_BUILD_SHARED_LIBS=1 -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -Dasync_web_server_cpp_EXPORTS -IE:\catkin_ws\src\async_web_server_cpp\include -IC:\opt\ros\noetic\x64\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG   /D _VARIADIC_MAX=10 /Zc:__cplusplus /showIncludes /Foasync_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\src\websocket_message.cpp.obj /Fdasync_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\ /FS -c E:\catkin_ws\src\async_web_server_cpp\src\websocket_message.cpp
Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
- add -D_WIN32_WINNT=0x0601 to the compiler command line; or
- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.
Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
E:\catkin_ws\src\async_web_server_cpp\include\async_web_server_cpp/websocket_message.hpp(49): error C2338: the Header struct is not properly packed
[4/6] Building CXX object async_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\src\websocket_connection.cpp.obj
FAILED: async_web_server_cpp/CMakeFiles/async_web_server_cpp.dir/src/websocket_connection.cpp.obj
C:\PROGRA~2\MICROS~4\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe  /nologo /TP -D-D_WIN32_WINNT=0x0A00 -DNOMINMAX -DROS_BUILD_SHARED_LIBS=1 -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -Dasync_web_server_cpp_EXPORTS -IE:\catkin_ws\src\async_web_server_cpp\include -IC:\opt\ros\noetic\x64\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG   /D _VARIADIC_MAX=10 /Zc:__cplusplus /showIncludes /Foasync_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\src\websocket_connection.cpp.obj /Fdasync_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\ /FS -c E:\catkin_ws\src\async_web_server_cpp\src\websocket_connection.cpp
Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
- add -D_WIN32_WINNT=0x0601 to the compiler command line; or
- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.
Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
E:\catkin_ws\src\async_web_server_cpp\include\async_web_server_cpp/websocket_message.hpp(49): error C2338: the Header struct is not properly packed
C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
[5/6] Building CXX object async_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\src\websocket_request_handler.cpp.obj
FAILED: async_web_server_cpp/CMakeFiles/async_web_server_cpp.dir/src/websocket_request_handler.cpp.obj
C:\PROGRA~2\MICROS~4\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe  /nologo /TP -D-D_WIN32_WINNT=0x0A00 -DNOMINMAX -DROS_BUILD_SHARED_LIBS=1 -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -Dasync_web_server_cpp_EXPORTS -IE:\catkin_ws\src\async_web_server_cpp\include -IC:\opt\ros\noetic\x64\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG   /D _VARIADIC_MAX=10 /Zc:__cplusplus /showIncludes /Foasync_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\src\websocket_request_handler.cpp.obj /Fdasync_web_server_cpp\CMakeFiles\async_web_server_cpp.dir\ /FS -c E:\catkin_ws\src\async_web_server_cpp\src\websocket_request_handler.cpp
Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
- add -D_WIN32_WINNT=0x0601 to the compiler command line; or
- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.
Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
E:\catkin_ws\src\async_web_server_cpp\include\async_web_server_cpp/websocket_message.hpp(49): error C2338: the Header struct is not properly packed
ninja: build stopped: subcommand failed.
Invoking "ninja -j32 -l32" failed