Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Chung
    @chungwong
    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
    Martin Chang
    @marty1885
    Ah. The coroutine error is expected.
    Chung
    @chungwong
    I tried to install libc++-dev, it didn't help much
    Martin Chang
    @marty1885
    It is a test to check if coroutine is avaliable.
    Chung
    @chungwong
    oh, that means something else caused the error
    Martin Chang
    @marty1885
    The latest PR makes some C++17 builds depend on Boost and Boost.Filesystem. (That what the CMake error is trying to tell you)
    Unable to find the requested Boost libraries.
    Chung
    @chungwong
    Thanks, I was reading the wiki boost, the version should be no less than 1.61, is required only if the C++ compiler does not support C++ 17. And couldn't tell if I need to install it
    Martin Chang
    @marty1885
    The PR was merged a day ago. We haven't updated the doc yet. Consider the docs to be correct for the releases. Not for the bleeding edge.
    Chung
    @chungwong
    Thanks, I installed libboost-all-dev for the peace of mind for now, although it installed a lot of deps which are unncessary.
    All worked!
    Aayush-2492
    @Aayush-2492

    I don't think so. We do have an example with axios. frontend backend

    Thanks for the help

    I want to make a chat room that does:

    1. When the send button is pressed client side uses DOM manip to get that string
    2. Using websockets, it sends it to the server.
    3. 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.

    interfector18
    @interfector18
    Vue is really good and easy to pick up, the frontend example you linked actually uses vue
    You should also look at awesome vue, to see if there are companion libraries you could use
    João Fernandes
    @0rangeFox
    In my opinion, I would suggest React with Redux and Axios.

    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.

    Aayush-2492
    @Aayush-2492
    Thanks for the suggestions @0rangeFox and @interfector18
    João Fernandes
    @0rangeFox
    You're welcome!
    Kaung Zaw Htet
    @KaungZawHtet
    Try flutter. Vue is just for web frontend. Flutter is for any kind of frontend: web, mobile and even desktop.
    N most popular choice in nowadays
    Chung
    @chungwong
    How do I actually add 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
    Chung
    @chungwong
    and I cannot find a reference to ParseAndAddDrogonTest in the whole source code.
    Did I get the idea wrong?
    João Fernandes
    @0rangeFox
    @chungwong Hey, I didn't understand, so, you mean, add framework "Drogon" to your project?
    Chung
    @chungwong
    @0rangeFox not really, I mean adding unit test to my drogon project
    which is integrating the testing framework of Drogon into CTest
    João Fernandes
    @0rangeFox
    Just curiosity, don't take it in bad way, mind I ask why you want it for?
    Chung
    @chungwong
    My hobby project at this moment doesn't have any unit testing. So it would be great if I can test the URLs I have made
    João Fernandes
    @0rangeFox
    Ah sure, I can recommend you the Postman application for it.
    Chung
    @chungwong
    but I guess it is not really testing? In that case I can use cURL to do that too?
    João Fernandes
    @0rangeFox
    Well, I use debugger from IDE and Postman to call it for check if everything is fine. But of course, you can use cURL for it.
    Chung
    @chungwong
    it would be great if we can just run make test to run all unit tests.
    I am just not familiar with how I should integrate drogon test to CTest
    Martin Chang
    @marty1885
    Hi @chungwong. That is a quark of CMake. There's no formal way to distribute cmake modules. The best we could do is to distribute it with the source and install is somewhere on your system.
    Either copy the file into your project and point CMAKE_MODULE_PATH to the containing folder. Or add this line somewhere before the include set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} /usr/lib/cmake/Drogon")(if you are on UNIX and installed drogon to /usr.
    In short:
    Chung
    @chungwong
    aha, no wonder I couldn't find any reference to ParseAndAddDrogonTest in the source. It is actually ParseAndAddDrogonTests
    Martin Chang
    @marty1885
    mkdir cmake
    wget "https://github.com/an-tao/drogon/blob/d888816997969435b907bec3881df7f4229f3583/cmake/ParseAndAddDrogonTests.cmake" -O cmake/ParseAndAddDrogonTests.cmake
    Then add set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake") somewhere at the beginning of your CMake script.
    Ah yes. I should fix that typo :P
    Chung
    @chungwong
    Thanks Martin. Let me try it out
    wait a second. I just realised I copied a template/file from Drogon's source code into my project, and then make some changes to my CMakeLists.txt. Isn't it the job of the generator Drogon has been using for generating the project template drogon_ctl create project your_project_name
    Martin Chang
    @marty1885
    You can customize the template as much as you wish.
    And we don't want to force users to use our own testing framework. Choosing testing frameworks is a touchy subject.
    Chung
    @chungwong
    of course not. However, what about
    drogon_ctl create project your_project_name --include_drogon_test
    Martin Chang
    @marty1885
    Good idea! You should open an issue and we could discuss in detail there
    Chung
    @chungwong
    Alababdiy
    @Alababdiy
    image.png
    My application not load controller
    image.png
    image.png