<?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[Nicht aufgelöstes externes Symbol]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe heute begonnen mit dem Programmmieren einer DLL. Doch nun habe ich scheinbar einen Fehler programmiert. Denn ich erhalte eine Fehlermeldung, dass ich drei &quot;Nicht aufgelöste externe Symbole&quot; habe. Hier ist der Code.</p>
<pre><code class="language-cpp">// Dark3DCubeEnginedll.h
//
// Definitions of the functions
//
#ifndef DARK_HPP
#define DARK_HPP

#include &lt;windows.h&gt;

// create a namespace, called DCE
//
namespace DCE
{
	// Create a class, called Dark3DCubeEngine
	//
	class Dark3DCubeEngine
	{
	public:

		__declspec(dllexport) Dark3DCubeEngine ();
		static __declspec(dllexport) void Initialize (const int WindowWidth, const int WindowHeight, const int WindowDepth);
		static __declspec(dllexport) HWND OpenWindow (HINSTANCE hInstance);
		static __declspec(dllexport) LRESULT WINAPI MsgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);

	private:

		static int m_WindowWidth;
		static int m_WindowHeight;
		static int m_WindowDepth;

	}; // End of the class

} // End of the namespace

#endif

// Dark3DCubeEnginedll.cpp
//
// Definitions of the functions
//
#include &quot;Dark3DCubeEnginedll.h&quot;

// Create a namespace, called DCE
//
namespace DCE
{
	Dark3DCubeEngine::Dark3DCubeEngine()
	{
		m_WindowWidth = 0;
		m_WindowHeight = 0;
		m_WindowDepth = 0;
	}

	void Dark3DCubeEngine::Initialize(const int WindowWidth, const int WindowHeight, const int WindowDepth)
	{
		Dark3DCubeEngine::m_WindowWidth = WindowWidth;
		Dark3DCubeEngine::m_WindowHeight = WindowHeight;
		Dark3DCubeEngine::m_WindowDepth = WindowDepth;
	}

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

		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)(COLOR_WINDOW);
		wc.lpszMenuName		= NULL;
		wc.lpszClassName	= TEXT (&quot;Dark3DCubeEngine&quot;);
		wc.hIconSm			= LoadIcon (NULL, IDI_APPLICATION);

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

		return CreateWindowEx (NULL, TEXT(&quot;Dark3DCubeEngine&quot;), &quot;Dark3DCubeEngine&quot;,
							   WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							   GetSystemMetrics(SM_CXSCREEN)/2 - 250,
							   GetSystemMetrics(SM_CYSCREEN)/2 - 187,
							   m_WindowWidth, m_WindowHeight, NULL,
							   NULL, hInstance, NULL);
	}

	LRESULT WINAPI Dark3DCubeEngine::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;
					}
				default: break;
				}
			} break;

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

		return DefWindowProc(hwnd, msg, wParam, lParam);
	}
} // End of the namespace
</code></pre>
<p>Hier ist die Fehlermeldung:</p>
<pre><code class="language-cpp">------ Erstellen gestartet: Projekt: Dark3DCubeEngine, Konfiguration: Debug Win32 ------
Kompilieren...
Dark3DCubeEnginedll.cpp
Manifest in Ressourcen wird kompiliert...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation.  All rights reserved.
Verknüpfen...
   Bibliothek &quot;C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Dark3DCubeEngine\Debug\Dark3DCubeEngine.lib&quot; und Objekt &quot;C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Dark3DCubeEngine\Debug\Dark3DCubeEngine.exp&quot; werden erstellt.
Dark3DCubeEnginedll.obj : error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;private: static int DCE::Dark3DCubeEngine::m_WindowDepth&quot; (?m_WindowDepth@Dark3DCubeEngine@DCE@@0HA)&quot;.
Dark3DCubeEnginedll.obj : error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;private: static int DCE::Dark3DCubeEngine::m_WindowHeight&quot; (?m_WindowHeight@Dark3DCubeEngine@DCE@@0HA)&quot;.
Dark3DCubeEnginedll.obj : error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;private: static int DCE::Dark3DCubeEngine::m_WindowWidth&quot; (?m_WindowWidth@Dark3DCubeEngine@DCE@@0HA)&quot;.
C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Dark3DCubeEngine\Debug\Dark3DCubeEngine.dll : 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\Dark3DCubeEngine\Debug\BuildLog.htm&quot; gespeichert.
Dark3DCubeEngine - 4 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Kann mir jemand sagen, was ich falsch programmiert habe?</p>
<p>Gruss Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/242585/nicht-aufgelöstes-externes-symbol</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 21:08:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/242585.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Jun 2009 14:05:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Nicht aufgelöstes externes Symbol on Fri, 05 Jun 2009 14:05:24 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe heute begonnen mit dem Programmmieren einer DLL. Doch nun habe ich scheinbar einen Fehler programmiert. Denn ich erhalte eine Fehlermeldung, dass ich drei &quot;Nicht aufgelöste externe Symbole&quot; habe. Hier ist der Code.</p>
<pre><code class="language-cpp">// Dark3DCubeEnginedll.h
//
// Definitions of the functions
//
#ifndef DARK_HPP
#define DARK_HPP

#include &lt;windows.h&gt;

// create a namespace, called DCE
//
namespace DCE
{
	// Create a class, called Dark3DCubeEngine
	//
	class Dark3DCubeEngine
	{
	public:

		__declspec(dllexport) Dark3DCubeEngine ();
		static __declspec(dllexport) void Initialize (const int WindowWidth, const int WindowHeight, const int WindowDepth);
		static __declspec(dllexport) HWND OpenWindow (HINSTANCE hInstance);
		static __declspec(dllexport) LRESULT WINAPI MsgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);

	private:

		static int m_WindowWidth;
		static int m_WindowHeight;
		static int m_WindowDepth;

	}; // End of the class

} // End of the namespace

#endif

// Dark3DCubeEnginedll.cpp
//
// Definitions of the functions
//
#include &quot;Dark3DCubeEnginedll.h&quot;

// Create a namespace, called DCE
//
namespace DCE
{
	Dark3DCubeEngine::Dark3DCubeEngine()
	{
		m_WindowWidth = 0;
		m_WindowHeight = 0;
		m_WindowDepth = 0;
	}

	void Dark3DCubeEngine::Initialize(const int WindowWidth, const int WindowHeight, const int WindowDepth)
	{
		Dark3DCubeEngine::m_WindowWidth = WindowWidth;
		Dark3DCubeEngine::m_WindowHeight = WindowHeight;
		Dark3DCubeEngine::m_WindowDepth = WindowDepth;
	}

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

		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)(COLOR_WINDOW);
		wc.lpszMenuName		= NULL;
		wc.lpszClassName	= TEXT (&quot;Dark3DCubeEngine&quot;);
		wc.hIconSm			= LoadIcon (NULL, IDI_APPLICATION);

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

		return CreateWindowEx (NULL, TEXT(&quot;Dark3DCubeEngine&quot;), &quot;Dark3DCubeEngine&quot;,
							   WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							   GetSystemMetrics(SM_CXSCREEN)/2 - 250,
							   GetSystemMetrics(SM_CYSCREEN)/2 - 187,
							   m_WindowWidth, m_WindowHeight, NULL,
							   NULL, hInstance, NULL);
	}

	LRESULT WINAPI Dark3DCubeEngine::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;
					}
				default: break;
				}
			} break;

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

		return DefWindowProc(hwnd, msg, wParam, lParam);
	}
} // End of the namespace
</code></pre>
<p>Hier ist die Fehlermeldung:</p>
<pre><code class="language-cpp">------ Erstellen gestartet: Projekt: Dark3DCubeEngine, Konfiguration: Debug Win32 ------
Kompilieren...
Dark3DCubeEnginedll.cpp
Manifest in Ressourcen wird kompiliert...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation.  All rights reserved.
Verknüpfen...
   Bibliothek &quot;C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Dark3DCubeEngine\Debug\Dark3DCubeEngine.lib&quot; und Objekt &quot;C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Dark3DCubeEngine\Debug\Dark3DCubeEngine.exp&quot; werden erstellt.
Dark3DCubeEnginedll.obj : error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;private: static int DCE::Dark3DCubeEngine::m_WindowDepth&quot; (?m_WindowDepth@Dark3DCubeEngine@DCE@@0HA)&quot;.
Dark3DCubeEnginedll.obj : error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;private: static int DCE::Dark3DCubeEngine::m_WindowHeight&quot; (?m_WindowHeight@Dark3DCubeEngine@DCE@@0HA)&quot;.
Dark3DCubeEnginedll.obj : error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;private: static int DCE::Dark3DCubeEngine::m_WindowWidth&quot; (?m_WindowWidth@Dark3DCubeEngine@DCE@@0HA)&quot;.
C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Dark3DCubeEngine\Debug\Dark3DCubeEngine.dll : 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\Dark3DCubeEngine\Debug\BuildLog.htm&quot; gespeichert.
Dark3DCubeEngine - 4 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Kann mir jemand sagen, was ich falsch programmiert habe?</p>
<p>Gruss Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1721791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1721791</guid><dc:creator><![CDATA[Eglifisch1]]></dc:creator><pubDate>Fri, 05 Jun 2009 14:05:24 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht aufgelöstes externes Symbol on Fri, 05 Jun 2009 14:19:08 GMT]]></title><description><![CDATA[<p>Das ist ja dein Header, oder?<br />
Dort deklarierst du die Variable ja nur. Du musst sie nur noch in deiner Implementierungsdatei definieren (und u.U. Initialisieren). <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-61231.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-61231.html</a><br />
D.h.</p>
<pre><code class="language-cpp">/// Dark3DCubeEnginedll.cpp
//
// Definitions of the functions
//
#include &quot;Dark3DCubeEnginedll.h&quot;

// Create a namespace, called DCE
//
namespace DCE
{
    static int Dark3DCubeEngine::m_WindowDepth;  // = 0
    static int Dark3DCubeEngine::m_WindowHeight; // = 0
    static int Dark3DCubeEngine::m_WindowWidth;  // = 0

    Dark3DCubeEngine::Dark3DCubeEngine()
    {
        // ...
    }

    void Dark3DCubeEngine::Initialize(const int WindowWidth, const int WindowHeight, const int WindowDepth)
    {
        // ...
    }

    HWND Dark3DCubeEngine::OpenWindow(HINSTANCE hInstance)
    {
        // ...
    }

    LRESULT WINAPI Dark3DCubeEngine::MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    {
        // ...
    }
} // End of the namespace
</code></pre>
<p>Noch viel Glück<br />
<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>s</mi><mi>k</mi><mi>r</mi><mi>m</mi></mrow><annotation encoding="application/x-tex">skrm</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.69444em;"></span><span class="strut bottom" style="height:0.69444em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit">s</span><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">m</span></span></span></span></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1721804</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1721804</guid><dc:creator><![CDATA[skrm]]></dc:creator><pubDate>Fri, 05 Jun 2009 14:19:08 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht aufgelöstes externes Symbol on Fri, 05 Jun 2009 14:34:43 GMT]]></title><description><![CDATA[<p>Danke für deine Antwort</p>
<p>Nun habe ich bei der .cpp Datei den Code beigefügt. Die Header-Datei habe ich so gelassen. Die .cpp Datei sieht nun so aus:</p>
<pre><code class="language-cpp">// Dark3DCubeEnginedll.cpp
//
// Definitions of the functions
//
#include &quot;Dark3DCubeEnginedll.h&quot;

// Create a namespace, called DCE
//
namespace DCE
{
	static int Dark3DCubeEngine::m_WindowDepth;  // = 0
	static int Dark3DCubeEngine::m_WindowHeight; // = 0
	static int Dark3DCubeEngine::m_WindowWidth;  // = 0 

	void Dark3DCubeEngine::Initialize(const int WindowWidth, const int WindowHeight, const int WindowDepth)
	{
		m_WindowWidth = WindowWidth;
		m_WindowHeight = WindowHeight;
		m_WindowDepth = WindowDepth;
	}

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

		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)(COLOR_WINDOW);
		wc.lpszMenuName		= NULL;
		wc.lpszClassName	= TEXT (&quot;Dark3DCubeEngine&quot;);
		wc.hIconSm			= LoadIcon (NULL, IDI_APPLICATION);

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

		return CreateWindowEx (NULL, TEXT(&quot;Dark3DCubeEngine&quot;), &quot;Dark3DCubeEngine&quot;,
							   WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							   GetSystemMetrics(SM_CXSCREEN)/2 - 250,
							   GetSystemMetrics(SM_CYSCREEN)/2 - 187,
							   m_WindowWidth, m_WindowHeight, NULL,
							   NULL, hInstance, NULL);
	}

	LRESULT WINAPI Dark3DCubeEngine::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;
					}
				default: break;
				}
			} break;

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

		return DefWindowProc(hwnd, msg, wParam, lParam);
	}
} // End of the namespace
</code></pre>
<p>Doch jetzt gibt es noch folgende drei Fehlermeldungen:</p>
<pre><code class="language-cpp">Erstellen gestartet: Projekt: Dark3DCubeEngine, Konfiguration: Debug Win32 ------
Kompilieren...
Dark3DCubeEnginedll.cpp
c:\dokumente und einstellungen\patrick\eigene dateien\visual studio 2008\projects\dark3dcubeengine\dark3dcubeenginedll.cpp(11) : error C2720: 'DCE::Dark3DCubeEngine::m_WindowDepth': 'static ' Speicherklassenspezifizierer für Elemente unzulässig
c:\dokumente und einstellungen\patrick\eigene dateien\visual studio 2008\projects\dark3dcubeengine\dark3dcubeenginedll.cpp(12) : error C2720: 'DCE::Dark3DCubeEngine::m_WindowHeight': 'static ' Speicherklassenspezifizierer für Elemente unzulässig
c:\dokumente und einstellungen\patrick\eigene dateien\visual studio 2008\projects\dark3dcubeengine\dark3dcubeenginedll.cpp(13) : error C2720: 'DCE::Dark3DCubeEngine::m_WindowWidth': 'static ' Speicherklassenspezifizierer für Elemente unzulässig
Das Buildprotokoll wurde unter &quot;file://c:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\Dark3DCubeEngine\Debug\BuildLog.htm&quot; gespeichert.
Dark3DCubeEngine - 3 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Weiss du was ich falsch programmiert habe?</p>
<p>Gruss Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1721819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1721819</guid><dc:creator><![CDATA[Eglifisch1]]></dc:creator><pubDate>Fri, 05 Jun 2009 14:34:43 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht aufgelöstes externes Symbol on Fri, 05 Jun 2009 15:36:45 GMT]]></title><description><![CDATA[<p>mach das static da weg das hat da nix verloren da droben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1721858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1721858</guid><dc:creator><![CDATA[fricks0r]]></dc:creator><pubDate>Fri, 05 Jun 2009 15:36:45 GMT</pubDate></item></channel></rss>