http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templatesから
私はチュートリアルに従っています。以下は私が行ったことです。
でcontent.h
:
#include <cppcms/view.h>
#include <string>
namespace content {
struct message : public cppcms::base_content {
std::string text;
};
}
でmy_skin.tmpl
:
<% c++ #include "content.h" %>
<% skin my_skin %>
<% view message uses content::message %>
<% template render() %>
<html>
<body>
<h1><%= text %> World!</h1>
</body>
<html>
<% end template %>
<% end view %>
<% end skin %>
インクルードを追加hello.cpp
:
#include <content.h>
コントローラを追加hello.cpp
:
virtual void main(std::string /*url*/)
{
content::message c;
c.text=">>>Hello<<<";
render("message",c);
}
runで静的にリンクmy_skin.cpp
すると、以下のエラーが発生します。hello.cpp
g++ hello.cpp my_skin.cpp -o hello -lcppcms -lbooster
hello.cpp:1:21: fatal error: content.h: No such file or directory
hello.cpp
とcontent.h
が同じディレクトリにあるため、なぜエラーが発生するのかわかりません