<?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[WinApi  Anfängerproblem]]></title><description><![CDATA[<p>Hallo, ich schreibe mit Visual C++ 2005 Express Edition folgenden copierten Code:</p>
<p>#define STRICT<br />
#include &lt;windows.h&gt;</p>
<p>LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);</p>
<p>LPCSTR lpszAppName = &quot;First_USB_API&quot;;<br />
LPCSTR lpszTitle = &quot;Meine erste Windows Applikation&quot;;</p>
<p>int APIENTRY WinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)<br />
{<br />
HWND hWnd;<br />
MSG msg;<br />
WNDCLASSEX wc;</p>
<p>wc.cbSize = sizeof(WNDCLASSEX);<br />
wc.style = CS_HREDRAW | CS_VREDRAW;<br />
wc.lpfnWndProc = WndProc;<br />
wc.cbClsExtra = 0;<br />
wc.cbWndExtra = 0;<br />
wc.hInstance = hInstance;<br />
wc.hCursor = LoadCursor(NULL,IDC_ARROW);<br />
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);<br />
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);<br />
wc.lpszClassName = lpszAppName;<br />
wc.lpszMenuName = lpszAppName;<br />
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);</p>
<p>if( RegisterClassEx(&amp;wc) == 0)<br />
return 0;</p>
<p>hWnd = CreateWindowEx(NULL,<br />
lpszAppName,<br />
lpszTitle,<br />
WS_OVERLAPPEDWINDOW,<br />
0,<br />
0,<br />
CW_USEDEFAULT,<br />
CW_USEDEFAULT,<br />
NULL,<br />
NULL,<br />
hInstance,<br />
NULL);</p>
<p>if( hWnd == NULL)<br />
return 0;</p>
<p>ShowWindow(hWnd, iCmdShow);<br />
UpdateWindow(hWnd);</p>
<p>while (GetMessage(&amp;msg, NULL, 0, 0) &gt; 0)<br />
{<br />
TranslateMessage(&amp;msg);<br />
DispatchMessage(&amp;msg);<br />
}<br />
return msg.wParam;</p>
<p>}</p>
<p>LRESULT CALLBACK WndProc(HWND hWnd, UINT umsg, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch (umsg)<br />
{<br />
case WM_DESTROY:<br />
{<br />
PostQuitMessage(0);<br />
return 0;<br />
}<br />
}<br />
return DefWindowProc(hWnd, umsg, wParam, lParam);<br />
}</p>
<p>und bekomme beim Build folgende Fehler Meldung:</p>
<p>Compiling...<br />
First_USB_API.cpp<br />
Linking...<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function &quot;long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WndProc@@YGJPAUHWND__@@IIJ@Z)<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function &quot;long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WndProc@@YGJPAUHWND__@@IIJ@Z)<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__GetMessageA@16 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__RegisterClassExA@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__GetStockObject@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function _WinMain@16<br />
C:\Dokumente und Einstellungen\Peer\Eigene Dateien\Visual Studio 2005\Projects\Test exe\Debug\Test.exe : fatal error LNK1120: 12 unresolved externals</p>
<p>Was habe ich da falsch gemacht? habe ich irgendwas wichtiges im Linker nicht eingestellt?</p>
<p>Gruß Peer</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/137263/winapi-anfängerproblem</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 04:33:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/137263.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Feb 2006 12:12:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Thu, 16 Feb 2006 12:12:45 GMT]]></title><description><![CDATA[<p>Hallo, ich schreibe mit Visual C++ 2005 Express Edition folgenden copierten Code:</p>
<p>#define STRICT<br />
#include &lt;windows.h&gt;</p>
<p>LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);</p>
<p>LPCSTR lpszAppName = &quot;First_USB_API&quot;;<br />
LPCSTR lpszTitle = &quot;Meine erste Windows Applikation&quot;;</p>
<p>int APIENTRY WinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)<br />
{<br />
HWND hWnd;<br />
MSG msg;<br />
WNDCLASSEX wc;</p>
<p>wc.cbSize = sizeof(WNDCLASSEX);<br />
wc.style = CS_HREDRAW | CS_VREDRAW;<br />
wc.lpfnWndProc = WndProc;<br />
wc.cbClsExtra = 0;<br />
wc.cbWndExtra = 0;<br />
wc.hInstance = hInstance;<br />
wc.hCursor = LoadCursor(NULL,IDC_ARROW);<br />
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);<br />
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);<br />
wc.lpszClassName = lpszAppName;<br />
wc.lpszMenuName = lpszAppName;<br />
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);</p>
<p>if( RegisterClassEx(&amp;wc) == 0)<br />
return 0;</p>
<p>hWnd = CreateWindowEx(NULL,<br />
lpszAppName,<br />
lpszTitle,<br />
WS_OVERLAPPEDWINDOW,<br />
0,<br />
0,<br />
CW_USEDEFAULT,<br />
CW_USEDEFAULT,<br />
NULL,<br />
NULL,<br />
hInstance,<br />
NULL);</p>
<p>if( hWnd == NULL)<br />
return 0;</p>
<p>ShowWindow(hWnd, iCmdShow);<br />
UpdateWindow(hWnd);</p>
<p>while (GetMessage(&amp;msg, NULL, 0, 0) &gt; 0)<br />
{<br />
TranslateMessage(&amp;msg);<br />
DispatchMessage(&amp;msg);<br />
}<br />
return msg.wParam;</p>
<p>}</p>
<p>LRESULT CALLBACK WndProc(HWND hWnd, UINT umsg, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch (umsg)<br />
{<br />
case WM_DESTROY:<br />
{<br />
PostQuitMessage(0);<br />
return 0;<br />
}<br />
}<br />
return DefWindowProc(hWnd, umsg, wParam, lParam);<br />
}</p>
<p>und bekomme beim Build folgende Fehler Meldung:</p>
<p>Compiling...<br />
First_USB_API.cpp<br />
Linking...<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function &quot;long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WndProc@@YGJPAUHWND__@@IIJ@Z)<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function &quot;long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)&quot; (?WndProc@@YGJPAUHWND__@@IIJ@Z)<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__GetMessageA@16 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__RegisterClassExA@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__GetStockObject@4 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function _WinMain@16<br />
First_USB_API.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function _WinMain@16<br />
C:\Dokumente und Einstellungen\Peer\Eigene Dateien\Visual Studio 2005\Projects\Test exe\Debug\Test.exe : fatal error LNK1120: 12 unresolved externals</p>
<p>Was habe ich da falsch gemacht? habe ich irgendwas wichtiges im Linker nicht eingestellt?</p>
<p>Gruß Peer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/995662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995662</guid><dc:creator><![CDATA[Nightstorm]]></dc:creator><pubDate>Thu, 16 Feb 2006 12:12:45 GMT</pubDate></item><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Thu, 16 Feb 2006 12:29:05 GMT]]></title><description><![CDATA[<p>Ich würde mal sagen, da fehlt 'ne Library - schau am besten mal in der Hilfe zu den angemeckerten Funktionen nach, welche Bibliothek du dem Linker mitgeben sollst und trage diese mit in die Projekteinstellungen ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/995684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995684</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 16 Feb 2006 12:29:05 GMT</pubDate></item><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Thu, 16 Feb 2006 12:43:53 GMT]]></title><description><![CDATA[<p>wichtig is kernel32.lib user32.lib und gdi32.lib</p>
<p>is bei vcexpress nicht standardmäßig inkludiert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/995698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995698</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Thu, 16 Feb 2006 12:43:53 GMT</pubDate></item><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Thu, 16 Feb 2006 12:51:02 GMT]]></title><description><![CDATA[<p>kernel.lib, user.lib und gdi.lib sind Bestandteile von Windows und werden beim Kompilieren automatisch eingebunden.</p>
<pre><code class="language-cpp">HWND hWnd;
MSG msg;//Hier heißt die Message msg
WNDCLASSEX wc; 
(....)
(....)
LRESULT CALLBACK WndProc(HWND hWnd, UINT umsg, WPARAM wParam, LPARAM lParam)
{
switch (umsg)//Hier heißt die Message umsg, die ist aber nicht definiert.
{
</code></pre>
<p>Siehe oben: die Nachricht umsg ist nicht definiert. Stattdessen hast Du MSG msg definiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/995701</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995701</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 16 Feb 2006 12:51:02 GMT</pubDate></item><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Thu, 16 Feb 2006 13:14:10 GMT]]></title><description><![CDATA[<blockquote>
<p>Siehe oben: die Nachricht umsg ist nicht definiert. Stattdessen hast Du MSG msg definiert.</p>
</blockquote>
<p>Quatsch. Er kommt umsg als Aufrufparameter in der Callback-Prozedur übergeben und wertet diesen auch aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/995728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995728</guid><dc:creator><![CDATA[mgs_]]></dc:creator><pubDate>Thu, 16 Feb 2006 13:14:10 GMT</pubDate></item><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Thu, 16 Feb 2006 18:25:13 GMT]]></title><description><![CDATA[<p>Elektronix schrieb:</p>
<blockquote>
<p>kernel.lib, user.lib und gdi.lib sind Bestandteile von Windows und werden beim Kompilieren automatisch eingebunden.</p>
</blockquote>
<p>Nope, davon kannst du nicht ausgehen. Welche Libs automtisch beim Linken berücksichtigt werden, hat VC in irgendwelchen Textfiles hinterlegt. Und das variiert von Version zu Version der IDE. Bei VC++ 2005 EE dürfte das zB lediglich kernel32.lib sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996087</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996087</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Thu, 16 Feb 2006 18:25:13 GMT</pubDate></item><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Thu, 16 Feb 2006 18:29:18 GMT]]></title><description><![CDATA[<p>Hast du ausversehen ein Konsolenprojekt angelegt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996094</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996094</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Thu, 16 Feb 2006 18:29:18 GMT</pubDate></item><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Fri, 17 Feb 2006 07:36:29 GMT]]></title><description><![CDATA[<p><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="🙂"
    /> jep haben die usert32.lib und die gdi32.lib gefehlt, jetzt klappt es.</p>
<p>Danke Peer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996376</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996376</guid><dc:creator><![CDATA[Nightstorm]]></dc:creator><pubDate>Fri, 17 Feb 2006 07:36:29 GMT</pubDate></item><item><title><![CDATA[Reply to WinApi  Anfängerproblem on Fri, 17 Feb 2006 07:57:31 GMT]]></title><description><![CDATA[<p>Nightstorm schrieb:</p>
<blockquote>
<p><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="🙂"
    /> jep haben die usert32.lib und die gdi32.lib gefehlt, jetzt klappt es.</p>
</blockquote>
<p>jaja user<strong>t</strong>32, nicht mal schreiben kann ich.</p>
<p>user32.lib meint ich natürlich</p>
<p>Peer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996396</guid><dc:creator><![CDATA[Nightstorm]]></dc:creator><pubDate>Fri, 17 Feb 2006 07:57:31 GMT</pubDate></item></channel></rss>