<?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[compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot;]]></title><description><![CDATA[<p>hi!</p>
<p>ich habe versucht, in ein ANSI C-programm ein klein wenig WinAPI-code zu integrieren. sieht IMHO auch recht gut aus, aber compilen kann ich es nicht <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>
<p>ich bekomme dauernd beim compilen mit MingW die errormessage: &quot;undefined reference to `GetOpenFileNameA@4'&quot;...</p>
<p>das hört sich für mich an, als wäre eine library nicht richtig eingebunden. aber ich habe einfach &quot;windows.h&quot; inkludiert, was laut MSDN reichen sollte.</p>
<p>sorry, ich kenne mich mit compilern und libs/includes noch nicht so dolle aus...</p>
<p>kann mir da jemand helfen?</p>
<p>danke im voraus,</p>
<p>---loki</p>
<p>/EDIT: zum besseren verständnis: ich benutze NUR die WinAPI-funktion &quot;GetOpenFileName&quot;. ziel ist es, in das programm einfach einen simplen fileopen-dialog zu integrieren, der den selektierten datei-pfad+namen als variable speichert, damit der restliche code darauf zugreifen kann...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/71037/compilerproblem-quot-undefined-reference-to-getopenfilenamea-4-quot</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 12:59:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/71037.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Apr 2004 11:16:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot; on Wed, 14 Apr 2004 11:20:42 GMT]]></title><description><![CDATA[<p>hi!</p>
<p>ich habe versucht, in ein ANSI C-programm ein klein wenig WinAPI-code zu integrieren. sieht IMHO auch recht gut aus, aber compilen kann ich es nicht <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>
<p>ich bekomme dauernd beim compilen mit MingW die errormessage: &quot;undefined reference to `GetOpenFileNameA@4'&quot;...</p>
<p>das hört sich für mich an, als wäre eine library nicht richtig eingebunden. aber ich habe einfach &quot;windows.h&quot; inkludiert, was laut MSDN reichen sollte.</p>
<p>sorry, ich kenne mich mit compilern und libs/includes noch nicht so dolle aus...</p>
<p>kann mir da jemand helfen?</p>
<p>danke im voraus,</p>
<p>---loki</p>
<p>/EDIT: zum besseren verständnis: ich benutze NUR die WinAPI-funktion &quot;GetOpenFileName&quot;. ziel ist es, in das programm einfach einen simplen fileopen-dialog zu integrieren, der den selektierten datei-pfad+namen als variable speichert, damit der restliche code darauf zugreifen kann...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/501235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501235</guid><dc:creator><![CDATA[loki1985]]></dc:creator><pubDate>Wed, 14 Apr 2004 11:20:42 GMT</pubDate></item><item><title><![CDATA[Reply to compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot; on Wed, 14 Apr 2004 11:39:39 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>loki1985 schrieb:</p>
<blockquote>
<p>ich habe versucht, in ein ANSI C-programm ein klein wenig WinAPI-code zu integrieren</p>
</blockquote>
<p>dann gehört deine Frage vielleicht schon nicht mehr unbedingt in dieses Forum, denn sobald eine API-Funktion enthalten ist, ist es kein ANSI-C-Programm mehr ;), denn eigentlich ist es eine Frage, wie beseitigt man Linker-Fehler</p>
<p>Trotzdem: in der MSDN gibt es zu jeder Funktionsbeschreibung einen ganz wichtigen Abschnitt, nämlich &quot;Requirements&quot;, und da steht im diesem Falle, du mußt comdlg32.lib zu den Bibliotheken für den Linker hinzufügen.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/501262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501262</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Wed, 14 Apr 2004 11:39:39 GMT</pubDate></item><item><title><![CDATA[Reply to compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot; on Wed, 14 Apr 2004 12:48:28 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=547" rel="nofollow">Shade Of Mine</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=10" rel="nofollow">ANSI C</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" 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/501323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501323</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 14 Apr 2004 12:48:28 GMT</pubDate></item><item><title><![CDATA[Reply to compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot; on Wed, 14 Apr 2004 13:43:33 GMT]]></title><description><![CDATA[<p>danke erstmal für die bisherigen infos <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="🙂"
    /> .<br />
ich habe mal nach der &quot;comdlg32.lib&quot; gesucht. habe ich nicht.<br />
muss ich dazu den Platform SDK von M$ runterladen? (die &quot;Core&quot;-variante, nehme ich mal an...)</p>
<p>und mit welchem command binde ich diese .lib explizit ein? habe es schon mit &quot;-L/user/local/lib -lcomdlg32.lib&quot; und varianten probiert...<br />
wie genau?</p>
<p>thx im voraus...</p>
<p>---loki</p>
]]></description><link>https://www.c-plusplus.net/forum/post/501377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501377</guid><dc:creator><![CDATA[loki1985]]></dc:creator><pubDate>Wed, 14 Apr 2004 13:43:33 GMT</pubDate></item><item><title><![CDATA[Reply to compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot; on Wed, 14 Apr 2004 13:52:25 GMT]]></title><description><![CDATA[<p>ich glaube schon, da0 du die hast, aber du mußt natürlich angeben, welchen Compiler du benutzt, dann kann man dir auch weiterhelfen. Schau also mal in dein Lib-Verzeichnis, ob da nicht ein comdlg32.a oder ähnliches herumliegt, es könnte z.B. so klappen:</p>
<p>&quot;-L/user/local/lib -lcomdlg32&quot;</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/501387</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501387</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Wed, 14 Apr 2004 13:52:25 GMT</pubDate></item><item><title><![CDATA[Reply to compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot; on Wed, 14 Apr 2004 15:22:59 GMT]]></title><description><![CDATA[<p>so long, hat geklappt. das problem lag nicht wie vermutet an der lib (die wurde scheinbar automatisch inkludiert, durch &quot;#define &lt;windows.h&gt;&quot;...), sondern daran, dass ein objekt per commandline mitgelinkt werden musste.<br />
lässt sich alles brav compilen, habe noch ein paar warnings gefixt (herrliches gefühl! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> ), und ich kann die anwendung auch starten.</p>
<p>leider kommt jetzt problem nummero 2:<br />
ich sehe nichts vom erwünschten file-open-dialog...<br />
stattdessen kommt nur die info, dass auf der commandline keine datei angegeben wurde. ich habe aber so umgecoded, dass die datei statt auf cmdline mit dem dialog angegeben wird.</p>
<p>ich poste mal die benutzte funktion des dialoges (abkopiert aus der MSDN):</p>
<pre><code>#include &quot;util.h&quot;
#include &lt;windows.h&gt;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) {
	FILE *ifp, *ofp;
	unsigned long file_record_off, file_record_len;
	unsigned long file_off, file_len;
	unsigned long data_file_len;
	const char *data_file_name;
	char file_name[0x20];
	char *buf;
	unsigned long i;
	int j;

OPENFILENAME ofn;
char szFile[260];
HWND hwnd;
HANDLE hf;

ZeroMemory(&amp;ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;

ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = &quot;All\0*.*\0&quot;;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;

if (GetOpenFileName(&amp;ofn)==TRUE) 
    hf = CreateFile(ofn.lpstrFile, GENERIC_READ,
        0, (LPSECURITY_ATTRIBUTES) NULL,
        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
        (HANDLE) NULL);
</code></pre>
<p>das müsste doch alles ANSI-C-kompatibel sein, oder? ich bekomme davon einfach nix zu sehen, und verstehe nicht wieso.......</p>
]]></description><link>https://www.c-plusplus.net/forum/post/501440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501440</guid><dc:creator><![CDATA[loki1985]]></dc:creator><pubDate>Wed, 14 Apr 2004 15:22:59 GMT</pubDate></item><item><title><![CDATA[Reply to compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot; on Wed, 14 Apr 2004 15:35:39 GMT]]></title><description><![CDATA[<p>mach mal hier NULL</p>
<pre><code class="language-cpp">ofn.hwndOwner = NULL;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/501444</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501444</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 14 Apr 2004 15:35:39 GMT</pubDate></item><item><title><![CDATA[Reply to compilerproblem: &amp;quot;undefined reference to &#96;GetOpenFileNameA@4&#x27;&amp;quot; on Thu, 15 Apr 2004 08:41:28 GMT]]></title><description><![CDATA[<p>super! vielen dank! jetzt funktioniert es!!!<br />
<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/501798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501798</guid><dc:creator><![CDATA[loki1985]]></dc:creator><pubDate>Thu, 15 Apr 2004 08:41:28 GMT</pubDate></item></channel></rss>