<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Grantlee]]></title><description><![CDATA[<p dir="auto">Hi there,</p>
<p dir="auto">has anybody experience compiling with Grantlee on Ubuntu?<br />
libgrantlee-dev is installed and auto-completion in QtCreator works fine, however I do not manage to get the example to build:</p>
<pre><code>#include &lt;grantlee_core.h&gt;
#include &lt;grantlee_templates.h&gt;
#include &lt;grantlee/engine.h&gt;
#include &lt;grantlee/template.h&gt;
#include &lt;grantlee/context.h&gt;
#include &lt;grantlee/variable.h&gt;

int main(int argc, char *argv[])
{
    Grantlee::Engine *engine = new Grantlee::Engine( 0 );
    Grantlee::Template t = engine-&gt;newTemplate("My name is {{ name }}.", "my_template_name");
    QVariantHash mapping;
    mapping.insert("name", "Grainne");
    Grantlee::Context c(mapping);
    t-&gt;render(&amp;c); // Returns "My name is Grainne."
    mapping.insert("name", "Henry");
    c = Grantlee::Context(mapping);
    qDebug() &lt;&lt; t-&gt;render(&amp;c); // Returns "My name is Henry."
</code></pre>
<p dir="auto">qmake &amp;&amp; make results in:<br />
undefined reference to `Grantlee::Engine::Engine(QObject*)'<br />
and many other undefinded-reference-errors, as I've missed some includes.</p>
<p dir="auto">Any ideas?<br />
Thanks in advance</p>
]]></description><link>https://forum.qt.io/topic/59389/grantlee</link><generator>RSS for Node</generator><lastBuildDate>Sun, 30 Aug 2026 09:40:45 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/59389.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Oct 2015 23:13:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Grantlee on Sun, 04 Oct 2015 12:19:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/monster_inc">@<bdi>Monster_Inc</bdi></a> said:<br />
Hi and welcome<br />
Since it is a extern lib, I assume you must<br />
add it to the .pro file<br />
something like<br />
LIBS += -L/path/tolib -lgrantlee</p>
<p dir="auto">often the L part is<br />
/usr/local/lib<br />
LIBS += -L/usr/local/lib -lgrantlee<br />
but should point to where the lib is.</p>
<p dir="auto">If its not linking errors, you get you might need to add the include<br />
path to the pro file also</p>
<p dir="auto">HEADERS  += mainwindow.h <br />
path to folder with  grantlee</p>
]]></description><link>https://forum.qt.io/post/292330</link><guid isPermaLink="true">https://forum.qt.io/post/292330</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 04 Oct 2015 12:19:50 GMT</pubDate></item></channel></rss>