diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 5ceea3ed..7aab1c1d 100755 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -17,4 +17,5 @@ endforeach() AUX_SOURCE_DIRECTORY(static_link_example DIR_STATIC) add_executable(webapp ${DIR_STATIC} ${VIEWSRC}) +add_dependencies(webapp drogon_ctl) diff --git a/examples/static_link_example/TestView.csp b/examples/static_link_example/TestView.csp index 6c24f561..7f6084d7 100755 --- a/examples/static_link_example/TestView.csp +++ b/examples/static_link_example/TestView.csp @@ -1,3 +1,9 @@ +<%inc +#include +%> +<%c++ +std::cout<<"this is a Http backend rendering Test"< <%c++ std::string title=@@.get("title");%> diff --git a/examples/static_link_example/TestViewCtl.cc b/examples/static_link_example/TestViewCtl.cc index 11b8f77c..9362b196 100755 --- a/examples/static_link_example/TestViewCtl.cc +++ b/examples/static_link_example/TestViewCtl.cc @@ -4,6 +4,6 @@ void TestViewCtl::asyncHandleHttpRequest(const HttpRequest& req,std::function res=std::unique_ptr(drogon::HttpResponse::newHttpViewResponse("TestViewClone",data)); + std::unique_ptr res=std::unique_ptr(drogon::HttpResponse::newHttpViewResponse("TestView",data)); callback(*res); } \ No newline at end of file