2

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.

apasajja
  • 576
  • 2
  • 6
  • 20

2 Answers2

2

before this we include our content.h header

Only means that the controller needs the header content.h in order to use: content::message c; (the content namespace used at the beginning of the tutorial). Which just means that you should add: #include "content.h" on the top of the controller file.

The controller file can be named whatever you want. The tutorial, however, expect you to call it hello.cpp near the end of the tutorial. Therefore you should call it that way (at least when following the tutorial).

Shoe
  • 74,840
  • 36
  • 166
  • 272
  • What name of the controller file? From the tutorial, the only files I know is `content.h` and `my_skin.tmpl` – apasajja Mar 21 '13 at 13:28
1

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.

Joseph Mansfield
  • 108,238
  • 20
  • 242
  • 324