<?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 gibt es einen solchen Fehler bei meiner Engine?]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich bin dabei, eine Engine zu schreiben. Doch ich weiss jetzt nicht genau, warum dieser Fehler auftritt, wenn ich folgenden Code eingebe:</p>
<pre><code class="language-cpp">// NPUEngine.h
//
// Die Hauptdatei der NPUEngine
//
#include &lt;windows.h&gt;

// namespace
//
namespace NPU
{ 	
	// Klasse erzeugen
	//
	class CNPUEngine
	{
	public:

		// Memberfunktionen
		//
		bool Init ();
		HWND InitWindow (HINSTANCE hInstance);
		static LRESULT CALLBACK BaseWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
		static LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);

	private:

	};
}

// NPUEngine.cpp
//
// Die Hauptdatei der NPUEngine
//
#include &quot;NPUEngine.h&quot;

HWND NPU::CNPUEngine::InitWindow(HINSTANCE hInstance)
{
	WNDCLASSEX wc;

	ZeroMemory (&amp;wc, sizeof (WNDCLASSEX));

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

	if (!RegisterClassEx (&amp;wc))
	{
		MessageBox (NULL, &quot;Fehler beim registerieren des Fenster&quot;, &quot;Fehler aufgetreten&quot;,
					MB_OK | MB_ICONEXCLAMATION);

		return 0;
	}

	return (CreateWindowEx (NULL, &quot;My Window&quot;, &quot;My Window&quot;,
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							100, 100, 800, 600, NULL, NULL,
							hInstance, NULL));
}

LRESULT CALLBACK NPU::CNPUEngine::BaseWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	return CNPUEngine::WndProc (hwnd, msg, wParam, lParam);
}

LRESULT CALLBACK NPU::CNPUEngine::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg)
	{
		// Ist eine Taste gedrückt worden?
		//
		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);
}
</code></pre>
<p>Folgende Fehler treten auf:</p>
<pre><code class="language-cpp">------ Erstellen gestartet: Projekt: NPUEngine, Konfiguration: Debug Win32 ------
Kompilieren...
NPUEngine.cpp
Verknüpfen...
MSVCRTD.lib(crtexew.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_WinMain@16&quot; in Funktion &quot;___tmainCRTStartup&quot;.
C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\NPUEngine\Debug\NPUEngine.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
Das Buildprotokoll wurde unter &quot;file://c:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\NPUEngine\NPUEngine\Debug\BuildLog.htm&quot; gespeichert.
NPUEngine - 2 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Weiss jemand was ich falsch gemacht habe?</p>
<p>Gruss Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/239929/warum-gibt-es-einen-solchen-fehler-bei-meiner-engine</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 11:39:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/239929.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 29 Apr 2009 15:21:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Warum gibt es einen solchen Fehler bei meiner Engine? on Wed, 29 Apr 2009 15:21:11 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich bin dabei, eine Engine zu schreiben. Doch ich weiss jetzt nicht genau, warum dieser Fehler auftritt, wenn ich folgenden Code eingebe:</p>
<pre><code class="language-cpp">// NPUEngine.h
//
// Die Hauptdatei der NPUEngine
//
#include &lt;windows.h&gt;

// namespace
//
namespace NPU
{ 	
	// Klasse erzeugen
	//
	class CNPUEngine
	{
	public:

		// Memberfunktionen
		//
		bool Init ();
		HWND InitWindow (HINSTANCE hInstance);
		static LRESULT CALLBACK BaseWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
		static LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);

	private:

	};
}

// NPUEngine.cpp
//
// Die Hauptdatei der NPUEngine
//
#include &quot;NPUEngine.h&quot;

HWND NPU::CNPUEngine::InitWindow(HINSTANCE hInstance)
{
	WNDCLASSEX wc;

	ZeroMemory (&amp;wc, sizeof (WNDCLASSEX));

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

	if (!RegisterClassEx (&amp;wc))
	{
		MessageBox (NULL, &quot;Fehler beim registerieren des Fenster&quot;, &quot;Fehler aufgetreten&quot;,
					MB_OK | MB_ICONEXCLAMATION);

		return 0;
	}

	return (CreateWindowEx (NULL, &quot;My Window&quot;, &quot;My Window&quot;,
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							100, 100, 800, 600, NULL, NULL,
							hInstance, NULL));
}

LRESULT CALLBACK NPU::CNPUEngine::BaseWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	return CNPUEngine::WndProc (hwnd, msg, wParam, lParam);
}

LRESULT CALLBACK NPU::CNPUEngine::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg)
	{
		// Ist eine Taste gedrückt worden?
		//
		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);
}
</code></pre>
<p>Folgende Fehler treten auf:</p>
<pre><code class="language-cpp">------ Erstellen gestartet: Projekt: NPUEngine, Konfiguration: Debug Win32 ------
Kompilieren...
NPUEngine.cpp
Verknüpfen...
MSVCRTD.lib(crtexew.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_WinMain@16&quot; in Funktion &quot;___tmainCRTStartup&quot;.
C:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\NPUEngine\Debug\NPUEngine.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
Das Buildprotokoll wurde unter &quot;file://c:\Dokumente und Einstellungen\patrick\Eigene Dateien\Visual Studio 2008\Projects\NPUEngine\NPUEngine\Debug\BuildLog.htm&quot; gespeichert.
NPUEngine - 2 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Weiss jemand was ich falsch gemacht habe?</p>
<p>Gruss Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703226</guid><dc:creator><![CDATA[Eglifisch1]]></dc:creator><pubDate>Wed, 29 Apr 2009 15:21:11 GMT</pubDate></item><item><title><![CDATA[Reply to Warum gibt es einen solchen Fehler bei meiner Engine? on Wed, 29 Apr 2009 15:48:54 GMT]]></title><description><![CDATA[<p>Öh, &quot;Win32 Konsolenanwendung&quot; anstatt &quot;Win32 Anwendung&quot; gewählt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703244</guid><dc:creator><![CDATA[Rat]]></dc:creator><pubDate>Wed, 29 Apr 2009 15:48:54 GMT</pubDate></item><item><title><![CDATA[Reply to Warum gibt es einen solchen Fehler bei meiner Engine? on Wed, 29 Apr 2009 16:50:13 GMT]]></title><description><![CDATA[<p>Nein ich habe schon eine Win32-Anwendung ausgewählt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703271</guid><dc:creator><![CDATA[Eglifisch1]]></dc:creator><pubDate>Wed, 29 Apr 2009 16:50:13 GMT</pubDate></item><item><title><![CDATA[Reply to Warum gibt es einen solchen Fehler bei meiner Engine? on Wed, 29 Apr 2009 17:18:57 GMT]]></title><description><![CDATA[<p>Die Fehlermeldung sagt doch schon alles. Du hast WinMain nicht implementiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703279</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Wed, 29 Apr 2009 17:18:57 GMT</pubDate></item><item><title><![CDATA[Reply to Warum gibt es einen solchen Fehler bei meiner Engine? on Wed, 29 Apr 2009 19:10:00 GMT]]></title><description><![CDATA[<p>Hehe, stimmt, wo denkst du denn beginnt dein Code?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703325</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703325</guid><dc:creator><![CDATA[Rat]]></dc:creator><pubDate>Wed, 29 Apr 2009 19:10:00 GMT</pubDate></item><item><title><![CDATA[Reply to Warum gibt es einen solchen Fehler bei meiner Engine? on Wed, 29 Apr 2009 19:42:35 GMT]]></title><description><![CDATA[<p>Ja ich weiss, doch es soll ja eine Engine sein, und die WinMain rufe ich erst im richtigen Programm auf. Kann ich das irgendwie einstellen, damit der Compiler nicht mehr reklamiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703353</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703353</guid><dc:creator><![CDATA[Eglifisch1]]></dc:creator><pubDate>Wed, 29 Apr 2009 19:42:35 GMT</pubDate></item><item><title><![CDATA[Reply to Warum gibt es einen solchen Fehler bei meiner Engine? on Wed, 29 Apr 2009 19:46:32 GMT]]></title><description><![CDATA[<p>Hihi, dann solltest du deinen Engine-Code zu einer Library machen. Bevor du hier fragst wie das geht, versuchs mal mit den FAQ oder google <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703355</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703355</guid><dc:creator><![CDATA[Rat]]></dc:creator><pubDate>Wed, 29 Apr 2009 19:46:32 GMT</pubDate></item></channel></rss>