<?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[Warum der Fehler ?]]></title><description><![CDATA[<p>Hallo,<br />
ich habe nur eine kurze Frage, mein Code sieht so aus:</p>
<pre><code class="language-cpp">#include &lt;irrlicht.h&gt;

using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#pragma comment(lib, &quot;Irrlicht.lib&quot;)

class Init{
public:

	void ini()
	{
	IrrlichtDevice *device =
		createDevice(EDT_DIRECT3D9, dimension2d&lt;s32&gt;(1024, 768), 16,
			true, false, false, 0);

	device-&gt;setWindowCaption(L&quot;Mindhunter 2k&quot;);

	IVideoDriver* driver = device-&gt;getVideoDriver();
	ISceneManager* smgr = device-&gt;getSceneManager();
	IGUIEnvironment* guienv = device-&gt;getGUIEnvironment();

	guienv-&gt;addStaticText(L&quot;This ist a V. 006 Beta from Mindhunters 2k&quot;,
		rect&lt;int&gt;(10,10,200,22), true);

	//Figur Laden
	IAnimatedMesh* mesh = smgr-&gt;getMesh(&quot;Objekte/person.3ds&quot;);
	IAnimatedMeshSceneNode* node = smgr-&gt;addAnimatedMeshSceneNode( mesh );

	//Map Laden
	device-&gt;getFileSystem()-&gt;addZipFileArchive(&quot;../../media/map-20kdm2.pk3&quot;);

	scene::IAnimatedMesh* map = smgr-&gt;getMesh(&quot;20kdm2.bsp&quot;);
	scene::ISceneNode* mapNode = 0;

	if (map)
		mapNode = smgr-&gt;addOctTreeSceneNode(map-&gt;getMesh(0));

	if (node)
	{
		node-&gt;setMaterialFlag(EMF_LIGHTING, false);
		//node-&gt;setFrameLoop(0, 310);
		//node-&gt;setMaterialTexture( 0, driver-&gt;getTexture(&quot;../../media/sydney.bmp&quot;) );
	}

	//Camera erstellen
	//smgr-&gt;addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
	smgr-&gt;addCameraSceneNodeFPS();

	// Zeichnen
	while(device-&gt;run())
	{
		/*
		Anything can be drawn between a beginScene() and an endScene()
		call. The beginScene clears the screen with a color and also the
		depth buffer if wanted. Then we let the Scene Manager and the
		GUI Environment draw their content. With the endScene() call
		everything is presented on the screen.
		*/
		driver-&gt;beginScene(true, true, SColor(255,100,101,140));

		smgr-&gt;drawAll();
		guienv-&gt;drawAll();

		driver-&gt;endScene();
	}

	// Device Leeren
	device-&gt;drop();
	}
};

int main()
{
	Init::ini();

	return 0;
}
</code></pre>
<p>und ich bekomme diesen Fehler:</p>
<p>--------------------Konfiguration: HelloWorld - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
main.cpp<br />
C:\irrlicht\irrlicht-0.14.0\examples\01.HelloWorld\main.cpp(85) : error C2352: 'Init::ini' : Unzulaessiger Aufruf einer nichtstatischen Member-Funktion<br />
C:\irrlicht\irrlicht-0.14.0\examples\01.HelloWorld\main.cpp(17) : Siehe Deklaration von 'ini'<br />
Fehler beim Ausführen von cl.exe.</p>
<p>HelloWorld.exe - 1 Fehler, 0 Warnung(en)</p>
<p>Und nun frage ich euch: &quot;Warum ? ;-)&quot;</p>
<p>Danke im Vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/143297/warum-der-fehler</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 04:03:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/143297.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 07 Apr 2006 07:20:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Warum der Fehler ? on Fri, 07 Apr 2006 07:20:08 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich habe nur eine kurze Frage, mein Code sieht so aus:</p>
<pre><code class="language-cpp">#include &lt;irrlicht.h&gt;

using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#pragma comment(lib, &quot;Irrlicht.lib&quot;)

class Init{
public:

	void ini()
	{
	IrrlichtDevice *device =
		createDevice(EDT_DIRECT3D9, dimension2d&lt;s32&gt;(1024, 768), 16,
			true, false, false, 0);

	device-&gt;setWindowCaption(L&quot;Mindhunter 2k&quot;);

	IVideoDriver* driver = device-&gt;getVideoDriver();
	ISceneManager* smgr = device-&gt;getSceneManager();
	IGUIEnvironment* guienv = device-&gt;getGUIEnvironment();

	guienv-&gt;addStaticText(L&quot;This ist a V. 006 Beta from Mindhunters 2k&quot;,
		rect&lt;int&gt;(10,10,200,22), true);

	//Figur Laden
	IAnimatedMesh* mesh = smgr-&gt;getMesh(&quot;Objekte/person.3ds&quot;);
	IAnimatedMeshSceneNode* node = smgr-&gt;addAnimatedMeshSceneNode( mesh );

	//Map Laden
	device-&gt;getFileSystem()-&gt;addZipFileArchive(&quot;../../media/map-20kdm2.pk3&quot;);

	scene::IAnimatedMesh* map = smgr-&gt;getMesh(&quot;20kdm2.bsp&quot;);
	scene::ISceneNode* mapNode = 0;

	if (map)
		mapNode = smgr-&gt;addOctTreeSceneNode(map-&gt;getMesh(0));

	if (node)
	{
		node-&gt;setMaterialFlag(EMF_LIGHTING, false);
		//node-&gt;setFrameLoop(0, 310);
		//node-&gt;setMaterialTexture( 0, driver-&gt;getTexture(&quot;../../media/sydney.bmp&quot;) );
	}

	//Camera erstellen
	//smgr-&gt;addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
	smgr-&gt;addCameraSceneNodeFPS();

	// Zeichnen
	while(device-&gt;run())
	{
		/*
		Anything can be drawn between a beginScene() and an endScene()
		call. The beginScene clears the screen with a color and also the
		depth buffer if wanted. Then we let the Scene Manager and the
		GUI Environment draw their content. With the endScene() call
		everything is presented on the screen.
		*/
		driver-&gt;beginScene(true, true, SColor(255,100,101,140));

		smgr-&gt;drawAll();
		guienv-&gt;drawAll();

		driver-&gt;endScene();
	}

	// Device Leeren
	device-&gt;drop();
	}
};

int main()
{
	Init::ini();

	return 0;
}
</code></pre>
<p>und ich bekomme diesen Fehler:</p>
<p>--------------------Konfiguration: HelloWorld - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
main.cpp<br />
C:\irrlicht\irrlicht-0.14.0\examples\01.HelloWorld\main.cpp(85) : error C2352: 'Init::ini' : Unzulaessiger Aufruf einer nichtstatischen Member-Funktion<br />
C:\irrlicht\irrlicht-0.14.0\examples\01.HelloWorld\main.cpp(17) : Siehe Deklaration von 'ini'<br />
Fehler beim Ausführen von cl.exe.</p>
<p>HelloWorld.exe - 1 Fehler, 0 Warnung(en)</p>
<p>Und nun frage ich euch: &quot;Warum ? ;-)&quot;</p>
<p>Danke im Vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1032334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1032334</guid><dc:creator><![CDATA[Anfänger88]]></dc:creator><pubDate>Fri, 07 Apr 2006 07:20:08 GMT</pubDate></item><item><title><![CDATA[Reply to Warum der Fehler ? on Fri, 07 Apr 2006 07:26:33 GMT]]></title><description><![CDATA[<p>Du benötigst ein Objekt vom Typ &quot;Init&quot;, um dessen Memberfunktionen aufzurufen:</p>
<pre><code class="language-cpp">int main()
{
  Init i;
  i.ini();
}
</code></pre>
<p>(alternativ könntest du die Methode als &quot;<strong>static</strong> void ini()&quot; definieren, dann klappt der Code so)</p>
<p>PS: Wozu brauchst du überhaupt die Klasse? Nimm lieber eine globale init()-Funktion, in die du den ganzen Kram reinpackst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1032335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1032335</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 07 Apr 2006 07:26:33 GMT</pubDate></item></channel></rss>