Search code examples
c++cppcms

CppCMS template tutorial: Where controller should be?


From http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates

The controller is:

virtual void main(std::string /*url*/)
{
    content::message c;
    c.text=">>>Hello<<<";
    render("message",c);
}

It says:

but before this we include our content.h header

Means it is in different file, but I dont know where it should be.


Solution

  • You can put it in a file named whatever you like. However, the compiler command below presumes you called it hello.cpp. This hello.cpp should have #include "content.h" at the top of it.