<?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 kommen diese Fehler?]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe es nun meine Engine so umgeschrieben, wie es userland mit gesagt hatte. Doch nun treten vier Fehler auf, bei diesem Code:</p>
<pre><code class="language-cpp">// Cube3DEngine.h
//
#ifndef CUBE3DENGINE_HPP
#define CUBE3DENGINE_HPP

#include &lt;windows.h&gt;
#include &quot;Cube3DEngineStructures.h&quot;

// create a namespace
//
namespace CE
{
	// create a class
	//
	class Cube3DEngine
	{
	public:

		void Initialize(CE::Cube3DEngineProperties &amp; props);
		void SetWindowProperties(int WindowWidth, int WindowHeight, int WindowDepth);
		HWND OpenWindow(HINSTANCE hInstance);
		static __declspec(dllexport)LRESULT WINAPI MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);

	private:

		int m_WindowWidth;
		int m_WindowHeight;
		int m_WindowDepth;

	}; // end of the class

	__declspec(dllexport)Cube3DEngine * CreateCube3DEngine(void)
	{
		return new Cube3DEngine();
	}

} // end of the namespace

#endif

// Cube3DEngine.cpp
//
#include &quot;Cube3DEngine.h&quot;

//create a namespce
//
namespace CE
{
	void Cube3DEngine::Initialize(CE::Cube3DEngineProperties &amp; props)
	{
		props.WindowWidth = m_WindowWidth;
		props.WindowHeight = m_WindowHeight;
		props.WindowDepth = m_WindowDepth;
	}

	void Cube3DEngine::SetWindowProperties(int WindowWidth, int WindowHeight, int WindowDepth)
	{
		m_WindowWidth = WindowWidth;
		m_WindowHeight = WindowHeight;
		m_WindowDepth = WindowDepth;
	}

	HWND Cube3DEngine::OpenWindow(HINSTANCE hInstance)
	{
		WNDCLASSEX wc;

		wc.style			= CS_HREDRAW | CS_VREDRAW;
		wc.cbSize			= sizeof (wc);
		wc.lpfnWndProc		= MsgProc;
		wc.cbClsExtra		= 0;
		wc.cbWndExtra		= 0;
		wc.hInstance		= hInstance;
		wc.hIcon			= LoadIcon (NULL, IDI_APPLICATION);
		wc.hCursor			= LoadCursor (NULL, IDC_ARROW);
		wc.hbrBackground	= (HBRUSH)GetStockObject(BLACK_BRUSH);
		wc.lpszMenuName		= NULL;
		wc.lpszClassName	= TEXT (&quot;Cube3DEngine&quot;);
		wc.hIconSm			= LoadIcon (NULL, IDI_APPLICATION);

		if (RegisterClassEx (&amp;wc) == 0) return 0;

		return CreateWindowEx (NULL, TEXT(&quot;Cube3DEngine&quot;), &quot;Cube3DEngine&quot;,
							   WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							   GetSystemMetrics(SM_CXSCREEN)/2 - 250,
							   GetSystemMetrics(SM_CYSCREEN)/2 - 187,
							   800, 600, NULL,
							   NULL, hInstance, NULL);
	}

	LRESULT WINAPI Cube3DEngine::MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
	{
		switch (msg)
		{
			// key was pressed
			//
		case WM_KEYDOWN:
			{
				switch (wParam)
				{
				case VK_ESCAPE:
					{
						PostMessage (hwnd, WM_CLOSE, 0, 0);
						return 0;
					} break;
				default: break;
				}
			} break;

		case WM_DESTROY:
			{
				PostQuitMessage (0);
				return 0;
			}
		default: break;
		}

		return DefWindowProc(hwnd, msg, wParam, lParam);
	}
} // end of the namespace

// main.h
//
#include &lt;windows.h&gt;
#include &lt;Cube3DEngine.h&gt;
#pragma comment(lib, &quot;Cube3DEngine.lib&quot;)

// create a class
//
class MyApplication : public CE::Cube3DEngine
{
public:

	MyApplication();
	virtual ~MyApplication();

};

// main.cpp
//
#include &quot;main.h&quot;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	MSG msg;
	HWND hwnd;
	bool bDone = false;
	CE::Cube3DEngine * pCubeEngine;
	CE::Cube3DEngineProperties props;

	pCubeEngine = CE::CreateCube3DEngine();
	pCubeEngine-&gt;Initialize(props);
	pCubeEngine-&gt;SetWindowProperties(800, 600, 32);
	hwnd = pCubeEngine-&gt;OpenWindow(hInstance);

	while (!bDone)
    {
        while (PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
        {
            TranslateMessage(&amp;msg);
            DispatchMessage(&amp;msg);
        }
    }

    delete pCubeEngine;
    return 0;
}
</code></pre>
<p>Und hier sind die vier Fehler, bei der Verwendung des Programm, main.cpp</p>
<pre><code class="language-cpp">------ Erstellen gestartet: Projekt: Cube3DEngineTest, Konfiguration: Debug Win32 ------
Verknüpfen...
   Bibliothek &quot;C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Cube3DEngineTest\Debug\Cube3DEngineTest.lib&quot; und Objekt &quot;C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Cube3DEngineTest\Debug\Cube3DEngineTest.exp&quot; werden erstellt.
main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;public: struct HWND__ * __thiscall CE::Cube3DEngine::OpenWindow(struct HINSTANCE__ *)&quot; (?OpenWindow@Cube3DEngine@CE@@QAEPAUHWND__@@PAUHINSTANCE__@@@Z)&quot; in Funktion &quot;_WinMain@16&quot;.
main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;public: void __thiscall CE::Cube3DEngine::SetWindowProperties(int,int,int)&quot; (?SetWindowProperties@Cube3DEngine@CE@@QAEXHHH@Z)&quot; in Funktion &quot;_WinMain@16&quot;.
main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;public: void __thiscall CE::Cube3DEngine::Initialize(struct CE::Cube3DEngineProperties &amp;)&quot; (?Initialize@Cube3DEngine@CE@@QAEXAAUCube3DEngineProperties@2@@Z)&quot; in Funktion &quot;_WinMain@16&quot;.
C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Cube3DEngineTest\Debug\Cube3DEngineTest.exe : fatal error LNK1120: 3 nicht aufgelöste externe Verweise.
Das Buildprotokoll wurde unter &quot;file://c:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Cube3DEngineTest\Cube3DEngineTest\Debug\BuildLog.htm&quot; gespeichert.
Cube3DEngineTest - 4 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Ich habe bei den Projekteinstellungen die Includeverzeichnisse und Libverzeichnisse eingestellt.</p>
<p>Kann mir jemand sagen, warum das die vier Fehler auftreten?</p>
<p>Gruss Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/243305/warum-kommen-diese-fehler</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 12:28:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/243305.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Jun 2009 12:08:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Warum kommen diese Fehler? on Mon, 15 Jun 2009 12:08:16 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe es nun meine Engine so umgeschrieben, wie es userland mit gesagt hatte. Doch nun treten vier Fehler auf, bei diesem Code:</p>
<pre><code class="language-cpp">// Cube3DEngine.h
//
#ifndef CUBE3DENGINE_HPP
#define CUBE3DENGINE_HPP

#include &lt;windows.h&gt;
#include &quot;Cube3DEngineStructures.h&quot;

// create a namespace
//
namespace CE
{
	// create a class
	//
	class Cube3DEngine
	{
	public:

		void Initialize(CE::Cube3DEngineProperties &amp; props);
		void SetWindowProperties(int WindowWidth, int WindowHeight, int WindowDepth);
		HWND OpenWindow(HINSTANCE hInstance);
		static __declspec(dllexport)LRESULT WINAPI MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);

	private:

		int m_WindowWidth;
		int m_WindowHeight;
		int m_WindowDepth;

	}; // end of the class

	__declspec(dllexport)Cube3DEngine * CreateCube3DEngine(void)
	{
		return new Cube3DEngine();
	}

} // end of the namespace

#endif

// Cube3DEngine.cpp
//
#include &quot;Cube3DEngine.h&quot;

//create a namespce
//
namespace CE
{
	void Cube3DEngine::Initialize(CE::Cube3DEngineProperties &amp; props)
	{
		props.WindowWidth = m_WindowWidth;
		props.WindowHeight = m_WindowHeight;
		props.WindowDepth = m_WindowDepth;
	}

	void Cube3DEngine::SetWindowProperties(int WindowWidth, int WindowHeight, int WindowDepth)
	{
		m_WindowWidth = WindowWidth;
		m_WindowHeight = WindowHeight;
		m_WindowDepth = WindowDepth;
	}

	HWND Cube3DEngine::OpenWindow(HINSTANCE hInstance)
	{
		WNDCLASSEX wc;

		wc.style			= CS_HREDRAW | CS_VREDRAW;
		wc.cbSize			= sizeof (wc);
		wc.lpfnWndProc		= MsgProc;
		wc.cbClsExtra		= 0;
		wc.cbWndExtra		= 0;
		wc.hInstance		= hInstance;
		wc.hIcon			= LoadIcon (NULL, IDI_APPLICATION);
		wc.hCursor			= LoadCursor (NULL, IDC_ARROW);
		wc.hbrBackground	= (HBRUSH)GetStockObject(BLACK_BRUSH);
		wc.lpszMenuName		= NULL;
		wc.lpszClassName	= TEXT (&quot;Cube3DEngine&quot;);
		wc.hIconSm			= LoadIcon (NULL, IDI_APPLICATION);

		if (RegisterClassEx (&amp;wc) == 0) return 0;

		return CreateWindowEx (NULL, TEXT(&quot;Cube3DEngine&quot;), &quot;Cube3DEngine&quot;,
							   WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							   GetSystemMetrics(SM_CXSCREEN)/2 - 250,
							   GetSystemMetrics(SM_CYSCREEN)/2 - 187,
							   800, 600, NULL,
							   NULL, hInstance, NULL);
	}

	LRESULT WINAPI Cube3DEngine::MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
	{
		switch (msg)
		{
			// key was pressed
			//
		case WM_KEYDOWN:
			{
				switch (wParam)
				{
				case VK_ESCAPE:
					{
						PostMessage (hwnd, WM_CLOSE, 0, 0);
						return 0;
					} break;
				default: break;
				}
			} break;

		case WM_DESTROY:
			{
				PostQuitMessage (0);
				return 0;
			}
		default: break;
		}

		return DefWindowProc(hwnd, msg, wParam, lParam);
	}
} // end of the namespace

// main.h
//
#include &lt;windows.h&gt;
#include &lt;Cube3DEngine.h&gt;
#pragma comment(lib, &quot;Cube3DEngine.lib&quot;)

// create a class
//
class MyApplication : public CE::Cube3DEngine
{
public:

	MyApplication();
	virtual ~MyApplication();

};

// main.cpp
//
#include &quot;main.h&quot;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	MSG msg;
	HWND hwnd;
	bool bDone = false;
	CE::Cube3DEngine * pCubeEngine;
	CE::Cube3DEngineProperties props;

	pCubeEngine = CE::CreateCube3DEngine();
	pCubeEngine-&gt;Initialize(props);
	pCubeEngine-&gt;SetWindowProperties(800, 600, 32);
	hwnd = pCubeEngine-&gt;OpenWindow(hInstance);

	while (!bDone)
    {
        while (PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
        {
            TranslateMessage(&amp;msg);
            DispatchMessage(&amp;msg);
        }
    }

    delete pCubeEngine;
    return 0;
}
</code></pre>
<p>Und hier sind die vier Fehler, bei der Verwendung des Programm, main.cpp</p>
<pre><code class="language-cpp">------ Erstellen gestartet: Projekt: Cube3DEngineTest, Konfiguration: Debug Win32 ------
Verknüpfen...
   Bibliothek &quot;C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Cube3DEngineTest\Debug\Cube3DEngineTest.lib&quot; und Objekt &quot;C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Cube3DEngineTest\Debug\Cube3DEngineTest.exp&quot; werden erstellt.
main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;public: struct HWND__ * __thiscall CE::Cube3DEngine::OpenWindow(struct HINSTANCE__ *)&quot; (?OpenWindow@Cube3DEngine@CE@@QAEPAUHWND__@@PAUHINSTANCE__@@@Z)&quot; in Funktion &quot;_WinMain@16&quot;.
main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;public: void __thiscall CE::Cube3DEngine::SetWindowProperties(int,int,int)&quot; (?SetWindowProperties@Cube3DEngine@CE@@QAEXHHH@Z)&quot; in Funktion &quot;_WinMain@16&quot;.
main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;public: void __thiscall CE::Cube3DEngine::Initialize(struct CE::Cube3DEngineProperties &amp;)&quot; (?Initialize@Cube3DEngine@CE@@QAEXAAUCube3DEngineProperties@2@@Z)&quot; in Funktion &quot;_WinMain@16&quot;.
C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Cube3DEngineTest\Debug\Cube3DEngineTest.exe : fatal error LNK1120: 3 nicht aufgelöste externe Verweise.
Das Buildprotokoll wurde unter &quot;file://c:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Cube3DEngineTest\Cube3DEngineTest\Debug\BuildLog.htm&quot; gespeichert.
Cube3DEngineTest - 4 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Ich habe bei den Projekteinstellungen die Includeverzeichnisse und Libverzeichnisse eingestellt.</p>
<p>Kann mir jemand sagen, warum das die vier Fehler auftreten?</p>
<p>Gruss Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726914</guid><dc:creator><![CDATA[Eglifisch1]]></dc:creator><pubDate>Mon, 15 Jun 2009 12:08:16 GMT</pubDate></item><item><title><![CDATA[Reply to Warum kommen diese Fehler? on Mon, 15 Jun 2009 23:09:25 GMT]]></title><description><![CDATA[<p>Pack das __declspec(dllexport) zwischen &quot;class&quot; und den Klassennamen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727273</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 15 Jun 2009 23:09:25 GMT</pubDate></item><item><title><![CDATA[Reply to Warum kommen diese Fehler? on Tue, 16 Jun 2009 10:34:41 GMT]]></title><description><![CDATA[<p>Ich habe nun __declspec(dllexport) zwieschen &quot;class&quot; und dem Klassennamen eingefügt. Doch es entstehen immer noch dieselben Fehler.</p>
<pre><code class="language-cpp">class __declspec(dllexport) Cube3DEngine
...
...
...

__declspec(dllexport)Cube3DEngine * CreateCube3DEngine(void)
{
	return new Cube3DEngine();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1727479</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727479</guid><dc:creator><![CDATA[Eglifisch1]]></dc:creator><pubDate>Tue, 16 Jun 2009 10:34:41 GMT</pubDate></item></channel></rss>