<?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[LuaPlus]]></title><description><![CDATA[<p>Hi,</p>
<p>ich bin mir nicht sicher, ob es in dieses Unterforum gehört. Ich habe ein Problem mit folgendem C++-Code, welches LuaPlus verwendet (ich hoffe, jemand<br />
kennt sich damit aus und kann mir helfen).</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;LuaPlus/Luaplus.h&gt;

int main()
{
   LuaPlus::LuaStateOwner state;
   state-&gt;DoString(&quot;function Add(x, y) return x + y end&quot;);

   LuaPlus::LuaFunction&lt;float&gt; Add = state-&gt;GetGlobal(&quot;Add&quot;) ; // &lt;-- Fehler!

   std::cout &lt;&lt; &quot;Add: &quot; &lt;&lt; Add(2, 7) &lt;&lt; std::endl;

   return 0;
}
</code></pre>
<p>Ich arbeite mit Dev-C++ 4.9.9.2 (Grundversion, also ohne jeglichen Updates) und dieser wirft mir folgenden Fehler raus:</p>
<pre><code>main.cpp:9: error: conversion from `LuaPlus::LuaObject' to non-scalar type `LuaPlus::LuaFunction&lt;float&gt;' requested
</code></pre>
<p>Ich verstehe diese Meldung nicht. Kann mir jemand weiterhelfen?<br />
Entsprechende Bibliotheken sind eingebunden.<br />
Danke im voraus.</p>
<p>BigBoomer</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/121622/luaplus</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 19:17:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/121622.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Sep 2005 05:30:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LuaPlus on Mon, 26 Sep 2005 05:30:10 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich bin mir nicht sicher, ob es in dieses Unterforum gehört. Ich habe ein Problem mit folgendem C++-Code, welches LuaPlus verwendet (ich hoffe, jemand<br />
kennt sich damit aus und kann mir helfen).</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;LuaPlus/Luaplus.h&gt;

int main()
{
   LuaPlus::LuaStateOwner state;
   state-&gt;DoString(&quot;function Add(x, y) return x + y end&quot;);

   LuaPlus::LuaFunction&lt;float&gt; Add = state-&gt;GetGlobal(&quot;Add&quot;) ; // &lt;-- Fehler!

   std::cout &lt;&lt; &quot;Add: &quot; &lt;&lt; Add(2, 7) &lt;&lt; std::endl;

   return 0;
}
</code></pre>
<p>Ich arbeite mit Dev-C++ 4.9.9.2 (Grundversion, also ohne jeglichen Updates) und dieser wirft mir folgenden Fehler raus:</p>
<pre><code>main.cpp:9: error: conversion from `LuaPlus::LuaObject' to non-scalar type `LuaPlus::LuaFunction&lt;float&gt;' requested
</code></pre>
<p>Ich verstehe diese Meldung nicht. Kann mir jemand weiterhelfen?<br />
Entsprechende Bibliotheken sind eingebunden.<br />
Danke im voraus.</p>
<p>BigBoomer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/880129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/880129</guid><dc:creator><![CDATA[BigBoomer]]></dc:creator><pubDate>Mon, 26 Sep 2005 05:30:10 GMT</pubDate></item><item><title><![CDATA[Reply to LuaPlus on Mon, 26 Sep 2005 06:49:08 GMT]]></title><description><![CDATA[<p>Och die ist doch eigentlich ganz verständlich.</p>
<pre><code class="language-cpp">state-&gt;GetGlobal(&quot;Add&quot;)
</code></pre>
<p>gibt anscheinend kein</p>
<pre><code class="language-cpp">LuaPlus::LuaFunction&lt;float&gt;
</code></pre>
<p>Objekt zurück.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/880155</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/880155</guid><dc:creator><![CDATA[Mathias]]></dc:creator><pubDate>Mon, 26 Sep 2005 06:49:08 GMT</pubDate></item><item><title><![CDATA[Reply to LuaPlus on Mon, 26 Sep 2005 12:52:50 GMT]]></title><description><![CDATA[<p>ich kenn mich mit Lua nicht aus, aber die fehlermeldung besagt, daß state-&gt;GetGlobal(&quot;Add&quot;) keine lua-funktion sondern ein LuaObjekt zurückgibt. warscheinlich mußt du die funktion erst mit einer dafür vorgesehenen methode aus dem objekt auslesen.</p>
<p>so in der richtung:</p>
<pre><code class="language-cpp">state-&gt;GetGlobal(&quot;Add&quot;)-&gt;DieLuaObjektFunktionsGetMethode();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/880417</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/880417</guid><dc:creator><![CDATA[Konfusius]]></dc:creator><pubDate>Mon, 26 Sep 2005 12:52:50 GMT</pubDate></item></channel></rss>