drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.57k stars 1.12k forks source link

Dynamic Loading of Views don't work on Windows #1298

Closed EXQ364 closed 6 months ago

EXQ364 commented 2 years ago

Hi. I can't get the behavior of dynamic views to work. The following has been done:

  1. In the CMake file, I have commented out the line "set_property(TARGET ${PROJECT_NAME} PROPERTY ENABLE_EXPORTS ON)"
  2. In the configuration file the following parameters are set
    "load_dynamic_views": true ,
    "dynamic_views_path": [
            "../views"
        ],
    "dynamic_views_output_path": "../views/build",

The project was created with the utility "drogon_ctl". The views work, but they don't compile dynamically, i.e. I need to rebuild the project to see the changes. I found that the views are compiled in the folder with the project, and not in the path prescribed in the configuration file ie work statically, although the documentation says that they should be built dynamically. What I do wrong?

an-tao commented 2 years ago

Dynamic views are not supported on Windows. https://github.com/drogonframework/drogon/blob/46c00a317f169369d416c1a4705bd561ef163d45/lib/src/HttpAppFrameworkImpl.cc#L530-L537

EXQ364 commented 2 years ago

Dynamic views are not supported on Windows.

https://github.com/drogonframework/drogon/blob/46c00a317f169369d416c1a4705bd561ef163d45/lib/src/HttpAppFrameworkImpl.cc#L530-L537 Thanks for the answer. Could you explain why this mechanism is not possible in windows? Just for my interest.

an-tao commented 2 years ago

Dynamic views are not supported on Windows. https://github.com/drogonframework/drogon/blob/46c00a317f169369d416c1a4705bd561ef163d45/lib/src/HttpAppFrameworkImpl.cc#L530-L537

Thanks for the answer. Could you explain why this mechanism is not possible in windows? Just for my interest.

I'm not familiar with dynamic libraries loading and reloading on Windows. you could make a PR for this if you like.