ucrt
(MSYS UCRT) environment and compile with clang (with -std=c++20 -fcoroutine-ts
). Clang's coroutine may work with MSVC's STL.
chung@debian:~/repos/drogon/build$ cmake ..
-- compiler: GNU
-- Could NOT find c-ares (missing: C-ARES_INCLUDE_DIRS C-ARES_LIBRARIES)
-- use c++17
CMake Error at /usr/share/cmake-3.13/Modules/FindBoost.cmake:2100 (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:151 (find_package)
-- Using Boost filesytem::path
-- Boost include dir: Boost_INCLUDE_DIR-NOTFOUND
-- Boost libraries:
-- jsoncpp verson:1.7.4
-- Found UUID: /usr/lib/x86_64-linux-gnu/libuuid.so
-- Could NOT find BROTLI (missing: BROTLIDEC_LIBRARY BROTLIENC_LIBRARY BROTLICOMMON_LIBRARY BROTLI_INCLUDE_DIR)
-- Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR)
-- Could NOT find pg (missing: PG_LIBRARIES PG_INCLUDE_DIRS)
-- Could NOT find MySQL (missing: MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS)
-- Could NOT find SQLite3 (missing: SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIRS)
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/cmake.csp
-- view classname:cmake
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/config.csp
-- view classname:config
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/demoMain.csp
-- view classname:demoMain
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/filter_cc.csp
-- view classname:filter_cc
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/filter_h.csp
-- view classname:filter_h
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/gitignore.csp
-- view classname:gitignore
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/model_cc.csp
-- view classname:model_cc
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/model_h.csp
-- view classname:model_h
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/model_json.csp
-- view classname:model_json
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/plugin_cc.csp
-- view classname:plugin_cc
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/plugin_h.csp
-- view classname:plugin_h
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/restful_controller_base_cc.csp
-- view classname:restful_controller_base_cc
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/restful_controller_base_h.csp
-- view classname:restful_controller_base_h
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/restful_controller_cc.csp
-- view classname:restful_controller_cc
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/restful_controller_custom_cc.csp
-- view classname:restful_controller_custom_cc
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/restful_controller_custom_h.csp
-- view classname:restful_controller_custom_h
-- cspFile:/home/chung/repos/drogon/drogon_ctl/templates/restful_controller_h.csp
-- view classname:restful_controller_h
-- bin:bin
-- Configuring incomplete, errors occurred!
See also "/home/chung/repos/drogon/build/CMakeFiles/CMakeOutput.log".
See also "/home/chung/repos/drogon/build/CMakeFiles/CMakeError.log".
chung@debian:~/repos/drogon/build$ cat /home/chung/repos/drogon/build/CMakeFiles/CMakeError.log
Determining if the include file coroutine exists failed with the following output:
Change Dir: /home/chung/repos/drogon/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_dfb66/fast"
/usr/bin/make -f CMakeFiles/cmTC_dfb66.dir/build.make CMakeFiles/cmTC_dfb66.dir/build
make[1]: Entering directory '/home/chung/repos/drogon/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_dfb66.dir/CheckIncludeFile.cxx.o
/usr/bin/c++ -o CMakeFiles/cmTC_dfb66.dir/CheckIncludeFile.cxx.o -c /home/chung/repos/drogon/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx
/home/chung/repos/drogon/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx:1:10: fatal error: coroutine: No such file or directory
#include <coroutine>
^~~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_dfb66.dir/build.make:66: CMakeFiles/cmTC_dfb66.dir/CheckIncludeFile.cxx.o] Error 1
make[1]: Leaving directory '/home/chung/repos/drogon/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_dfb66/fast] Error 2
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/chung/repos/drogon/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_2c221/fast"
/usr/bin/make -f CMakeFiles/cmTC_2c221.dir/build.make CMakeFiles/cmTC_2c221.dir/build
make[1]: Entering directory '/home/chung/repos/drogon/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2c221.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_2c221.dir/CheckSymbolExists.c.o -c /home/chung/repos/drogon/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_2c221
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2c221.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_2c221.dir/CheckSymbolExists.c.o -o cmTC_2c221
/usr/bin/ld: CMakeFiles/cmTC_2c221.dir/CheckSymbolExists.c.o: in function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_2c221.dir/build.make:87: cmTC_2c221] Error 1
make[1]: Leaving directory '/home/chung/repos/drogon/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_2c221/fast] Error 2
File /home/chung/repos/drogon/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/chung/repos/drogon/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_41af8/fast"
/usr/bin/make -f CMakeFiles/cmTC_41af8.dir/build.make CMakeFiles/cmTC_41af8.dir/build
make[1]: Entering directory '/home/chung/repos/drogon/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_41af8.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_41af8.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.13/Modules/CheckFunctionExists.c
Linking C executable cmTC_41af8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_41af8.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_41af8.dir/CheckFunctionExists.c.o -o cmTC_41af8 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_41af8.dir/build.make:87: cmTC_41af8] Error 1
make[1]: Leaving directory '/home/chung/repos/drogon/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_41af8/fast] Error 2
Unable to find the requested Boost libraries.
I want to make a chat room that does:
- When the send button is pressed client side uses DOM manip to get that string
- Using websockets, it sends it to the server.
- Server manipulates the DOM to add the new message in an html file so that every other client in the chatroom can see that message.
Could anyone suggest a suitable front-end framework I could explore to achieve this task.
You can try using the
ucrt
(MSYS UCRT) environment and compile with clang (with-std=c++20 -fcoroutine-ts
). Clang's coroutine may work with MSVC's STL.
When I have plenty of time for these experiments I will test this, for now I am using my Linux server which works best.
Drogon
to CTest
? I am a bit confused about the doc given that I am still new to C++
I created the following under Drogon root dir with some dummy tests.
tests
├── CMakeLists.txt
└── main.cc
when I did
cd build
cmake ..
make && make test
everything worked. However, when I tried to add drogon
into CTest.
file: test/CMakeLists.txt
add_executable(main main.cc)
add_test(main main)
# FIXME
# include(ParseAndAddDrogonTest)
# add_executable(main main.cc)
# target_link_libraries(main PRIVATE drogon)
# ParseAndAddDrogonTest(main)
It threw an error at me
CMake Error at tests/CMakeLists.txt:5 (include):
include could not find load file:
ParseAndAddDrogonTest