<?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[Problem mit einfacher Windows Application]]></title><description><![CDATA[<p>Hallo, hab mir ein einfaches Fenster gecoded, dabei tritt der Fehler &quot;Undefined Reference to `WinMain@16'&quot; auf. Woran kann das Liegen?</p>
<p>Compiler: Code::Blocks</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
const char szAppName[] = &quot;Ein eigenes Fenster&quot;;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpszCmdLine, UINT iCmdShow)
{
    HWND hWnd;
    MSG msg;
    WNDCLASS wc;

    wc.style = CS_VREDRAW | CS_HREDRAW;
    wc.lpfnWndProc = WndProc;

    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;

    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hInstance = hInstance;
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);

    wc.lpszClassName = szAppName;
    wc.lpszMenuName = NULL;

    RegisterClass(&amp;wc);

    hWnd = CreateWindow(szAppName, &quot;Titelleiste&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 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;
        break;
    }

    return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/217531/problem-mit-einfacher-windows-application</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 06:02:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/217531.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 Jul 2008 14:02:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit einfacher Windows Application on Tue, 08 Jul 2008 14:02:43 GMT]]></title><description><![CDATA[<p>Hallo, hab mir ein einfaches Fenster gecoded, dabei tritt der Fehler &quot;Undefined Reference to `WinMain@16'&quot; auf. Woran kann das Liegen?</p>
<p>Compiler: Code::Blocks</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
const char szAppName[] = &quot;Ein eigenes Fenster&quot;;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpszCmdLine, UINT iCmdShow)
{
    HWND hWnd;
    MSG msg;
    WNDCLASS wc;

    wc.style = CS_VREDRAW | CS_HREDRAW;
    wc.lpfnWndProc = WndProc;

    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;

    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hInstance = hInstance;
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);

    wc.lpszClassName = szAppName;
    wc.lpszMenuName = NULL;

    RegisterClass(&amp;wc);

    hWnd = CreateWindow(szAppName, &quot;Titelleiste&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 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;
        break;
    }

    return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1543499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543499</guid><dc:creator><![CDATA[Arr0ws]]></dc:creator><pubDate>Tue, 08 Jul 2008 14:02:43 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einfacher Windows Application on Tue, 08 Jul 2008 14:15:25 GMT]]></title><description><![CDATA[<p>Falsches Forum bitte Verschieben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543511</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Tue, 08 Jul 2008 14:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einfacher Windows Application on Tue, 08 Jul 2008 14:58:45 GMT]]></title><description><![CDATA[<p>Für ein Windows-Programm musst Du ein Projekt (In Code::Blocks z.B. &quot;Win32 GUI Project&quot;) erstellen. Dafür liefert Dir Code::Blocks dann gleich den ganzen Sourcecode. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543521</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543521</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Tue, 08 Jul 2008 14:58:45 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einfacher Windows Application on Tue, 08 Jul 2008 16:23:27 GMT]]></title><description><![CDATA[<p>Hab ich ja gemacht, (dieser Code ist von Dev-Cpp) Win-Gui Project.</p>
<p>-&gt; Sry, habs im Falschen Forum geposted :D, bitte ins Win-Api Forum verschieben</p>
<p>Das Problem löst sich komischerweise, wenn ich eine Main() Funktion ohne Inhalt hinzufüge, allerdings bekomme ich dann kein Fenster zu sehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543596</guid><dc:creator><![CDATA[Arr0ws]]></dc:creator><pubDate>Tue, 08 Jul 2008 16:23:27 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einfacher Windows Application on Tue, 08 Jul 2008 16:21:58 GMT]]></title><description><![CDATA[<p>ja, so gesehen richtig...<br />
aber fenster basteln mit windows.h ist WinAPI und dafür gibts hier auch ein Sub-Forum</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543598</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Tue, 08 Jul 2008 16:21:58 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einfacher Windows Application on Tue, 08 Jul 2008 16:27:41 GMT]]></title><description><![CDATA[<p>Arr0ws schrieb:</p>
<blockquote>
<p>Hab ich ja gemacht, (dieser Code ist von Dev-Cpp) Win-Gui Project.</p>
<p>-&gt; Sry, habs im Falschen Forum geposted :D, bitte ins Win-Api Forum verschieben</p>
<p>Das Problem löst sich komischerweise, wenn ich eine Main() Funktion ohne Inhalt hinzufüge, allerdings bekomme ich dann kein Fenster zu sehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
</blockquote>
<p>Scheint so, als ob die lib nicht richtig gelinkt wurde. Überprüf das doch mal, oder erzeug mal ein neues Projekt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543605</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543605</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 08 Jul 2008 16:27:41 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einfacher Windows Application on Tue, 08 Jul 2008 16:40:01 GMT]]></title><description><![CDATA[<p>Fehler gefunden - Durch überprüfung mit dem Code den Code::Blocks selber erstellt.</p>
<p>Und er ist (wie immer) so einfach:</p>
<p>int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpszCmdLine, <em><strong>UINT iCmdShow</strong></em>)</p>
<p>Es gehört int iCmdShow (klarerweise)...<br />
Komischer Fehler, den der Compiler da ausgegeben hat ^^</p>
<p>Hier nochmal der Code der Einwandfrei läuft:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
const char szAppName[] = &quot;Ein eigenes Fenster&quot;;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpszCmdLine, int iCmdShow)
{
    HWND hWnd;
    MSG msg;
    WNDCLASS wc;

    wc.style = CS_VREDRAW | CS_HREDRAW;
    wc.lpfnWndProc = WndProc;

    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;

    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hInstance = hInstance;
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);

    wc.lpszClassName = szAppName;
    wc.lpszMenuName = NULL;

    RegisterClass(&amp;wc);

    hWnd = CreateWindow(szAppName, &quot;Titelleiste&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 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;
        break;
    }

    return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1543614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543614</guid><dc:creator><![CDATA[Arr0ws]]></dc:creator><pubDate>Tue, 08 Jul 2008 16:40:01 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einfacher Windows Application on Mon, 14 Jul 2008 17:15:40 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1547259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1547259</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 14 Jul 2008 17:15:40 GMT</pubDate></item></channel></rss>