<?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[Fehler beim Kompilieren]]></title><description><![CDATA[<p>Hallo,<br />
ich versuche jetzt schon ne Woche mit dem Visual C++ 2005 Express Edition<br />
ein einfaches Fenster über die WinAPI zu programmieren.</p>
<p>Das Hier ist der Text:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

const char szAppName[] = &quot;Window&quot;;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
				   LPSTR szCmdLine, int iCmdShow)
{
	HWND       hWnd;
	MSG        msg;
	WNDCLASS   wc;

	wc.style               = CS_HREDRAW | CS_VREDRAW;
	wc.lpfnWndProc         = WndProc;
	wc.cbClsExtra          = 0;
	wc.cbWndExtra          = 0;
	wc.hInstance           = hInstance;
	wc.hCursor             = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon               = LoadIcon(NULL, IDI_APPLICATION);
	wc.hbrBackground       = (HBRUSH)GetStockObject(BLACK_BRUSH);
	wc.lpszClassName       = szAppName;
	wc.lpszMenuName        = NULL;

	RegisterClass(&amp;wc);

	hWnd = CreateWindow(szAppName,
		                szAppName,
						WS_OVERLAPPEDWINDOW,
						0,
						0,
						320,
						240,
						NULL,
						NULL,
						hInstance,
						NULL);

	ShowWindow(hWnd, iCmdShow);
	UpdateWindow(hWnd);

	while(GetMessage(&amp;msg, NULL, 0, 0))
	{
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	   case WM_DESTROY:
	   {
		   PostQuitMessage(0);
		   return 0;
	   }
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
<p>Ich kenn mich in der WinAPI noch nicht besonders gut aus, aber ich denke schon, das der Text richtig ist, den im Borland C++ Builder funktioniert er einwandfrei.</p>
<p>Aber im VC++ bekomm ich immer diese Fehlermeldung:</p>
<pre><code>1&gt;------ Erstellen gestartet: Projekt: 4, Konfiguration: Debug Win32 ------
1&gt;Kompilieren...
1&gt;main.cpp
1&gt;Verknüpfen...
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__PostQuitMessage@4&quot; in Funktion &quot;&quot;long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WndProc@@YGJPAUHWND__@@IIJ@Z)&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__DefWindowProcA@16&quot; in Funktion &quot;&quot;long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WndProc@@YGJPAUHWND__@@IIJ@Z)&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__TranslateMessage@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__DispatchMessageA@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__GetMessageA@16&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__UpdateWindow@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__ShowWindow@8&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__CreateWindowExA@48&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__RegisterClassA@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__GetStockObject@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__LoadIconA@8&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__LoadCursorA@8&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;C:\Dokumente und Einstellungen\Phil\Eigene Dateien\Visual Studio 2005\Projects\4\Debug\4.exe : fatal error LNK1120: 12 nicht aufgelöste externe Verweise.
1&gt;Das Buildprotokoll wurde unter &quot;file://c:\Dokumente und Einstellungen\Phil\Eigene Dateien\Visual Studio 2005\Projects\4\4\Debug\BuildLog.htm&quot; gespeichert.
1&gt;4 - 13 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Kann mir da jemand helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/176095/fehler-beim-kompilieren</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 10:59:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/176095.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Mar 2007 15:48:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler beim Kompilieren on Sat, 17 Mar 2007 15:48:36 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich versuche jetzt schon ne Woche mit dem Visual C++ 2005 Express Edition<br />
ein einfaches Fenster über die WinAPI zu programmieren.</p>
<p>Das Hier ist der Text:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

const char szAppName[] = &quot;Window&quot;;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
				   LPSTR szCmdLine, int iCmdShow)
{
	HWND       hWnd;
	MSG        msg;
	WNDCLASS   wc;

	wc.style               = CS_HREDRAW | CS_VREDRAW;
	wc.lpfnWndProc         = WndProc;
	wc.cbClsExtra          = 0;
	wc.cbWndExtra          = 0;
	wc.hInstance           = hInstance;
	wc.hCursor             = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon               = LoadIcon(NULL, IDI_APPLICATION);
	wc.hbrBackground       = (HBRUSH)GetStockObject(BLACK_BRUSH);
	wc.lpszClassName       = szAppName;
	wc.lpszMenuName        = NULL;

	RegisterClass(&amp;wc);

	hWnd = CreateWindow(szAppName,
		                szAppName,
						WS_OVERLAPPEDWINDOW,
						0,
						0,
						320,
						240,
						NULL,
						NULL,
						hInstance,
						NULL);

	ShowWindow(hWnd, iCmdShow);
	UpdateWindow(hWnd);

	while(GetMessage(&amp;msg, NULL, 0, 0))
	{
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	   case WM_DESTROY:
	   {
		   PostQuitMessage(0);
		   return 0;
	   }
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
<p>Ich kenn mich in der WinAPI noch nicht besonders gut aus, aber ich denke schon, das der Text richtig ist, den im Borland C++ Builder funktioniert er einwandfrei.</p>
<p>Aber im VC++ bekomm ich immer diese Fehlermeldung:</p>
<pre><code>1&gt;------ Erstellen gestartet: Projekt: 4, Konfiguration: Debug Win32 ------
1&gt;Kompilieren...
1&gt;main.cpp
1&gt;Verknüpfen...
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__PostQuitMessage@4&quot; in Funktion &quot;&quot;long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WndProc@@YGJPAUHWND__@@IIJ@Z)&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__DefWindowProcA@16&quot; in Funktion &quot;&quot;long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WndProc@@YGJPAUHWND__@@IIJ@Z)&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__TranslateMessage@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__DispatchMessageA@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__GetMessageA@16&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__UpdateWindow@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__ShowWindow@8&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__CreateWindowExA@48&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__RegisterClassA@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__GetStockObject@4&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__LoadIconA@8&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;__imp__LoadCursorA@8&quot; in Funktion &quot;_WinMain@16&quot;.
1&gt;C:\Dokumente und Einstellungen\Phil\Eigene Dateien\Visual Studio 2005\Projects\4\Debug\4.exe : fatal error LNK1120: 12 nicht aufgelöste externe Verweise.
1&gt;Das Buildprotokoll wurde unter &quot;file://c:\Dokumente und Einstellungen\Phil\Eigene Dateien\Visual Studio 2005\Projects\4\4\Debug\BuildLog.htm&quot; gespeichert.
1&gt;4 - 13 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>Kann mir da jemand helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247312</guid><dc:creator><![CDATA[Phil 18]]></dc:creator><pubDate>Sat, 17 Mar 2007 15:48:36 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler beim Kompilieren on Sat, 17 Mar 2007 15:56:29 GMT]]></title><description><![CDATA[<p>Dann nimmt man sich die 1. beste Fehler verursachende Funktion und guckt nach wo se denn definiert ist. <a href="http://msdn2.microsoft.com/en-us/library/ms644945.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms644945.aspx</a> ... und man sieht, das man user32.lib linken muss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247318</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247318</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sat, 17 Mar 2007 15:56:29 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler beim Kompilieren on Sat, 17 Mar 2007 17:46:03 GMT]]></title><description><![CDATA[<p>(D)Evil schrieb:</p>
<blockquote>
<p>Dann nimmt man sich die 1. beste Fehler verursachende Funktion und guckt nach wo se denn definiert ist. <a href="http://msdn2.microsoft.com/en-us/library/ms644945.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms644945.aspx</a> ... und man sieht, das man user32.lib linken muss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
</blockquote>
<p>Vielen Vielen Dank, nun komm ich zurecht. <sup>_</sup><br />
Hab schon ne Woche lang rum probiert T_T</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247392</guid><dc:creator><![CDATA[Phil 18]]></dc:creator><pubDate>Sat, 17 Mar 2007 17:46:03 GMT</pubDate></item></channel></rss>