drogonframework / drogon

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

Simple example to create a view does not work #2168

Closed bradleysmith closed 2 months ago

bradleysmith commented 2 months ago

Notice If you need support or clarification regarding the usage of Drogon in your project, visit the official Drogon support channel at gitter

Please create a new issue only if you think you have found a bug or if have a feature request/enhancement.

Describe the bug Following the instructions here:

https://github.com/drogonframework/drogon/wiki/ENG-06-View

when you come to build you get this error:

/build/ListParameters.cc: In member function ‘virtual std::string ListParameters::genText(const drogon::DrTemplateData&)’: /home/brad/work/1001_drogon/build/ListParameters.cc:22:87: error: ‘utils’ was not declared in this scope

auto para=ListParameters_view_data.get<std::unordered_map<std::string,std::string,utils::internal::SafeStringHash>>("parameters");

To Reproduce Steps to reproduce the behavior:

  1. Modify main.cc as described
  2. Past the supplied csp code into the named file
  3. Perform the create view
  4. navigate to build folder
  5. run new cmake
  6. run make

Expected behavior Code compiles

Desktop (please complete the following information):

bradleysmith commented 2 months ago

Duplicate of https://github.com/drogonframework/drogon/issues/1963