<?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[externe deklarationen in dll nicht bekannt (Application, externe funktion) - linker fehler]]></title><description><![CDATA[<p>Hallo mal wieder,<br />
habe ein lustiges problem mit meiner dll. obwohl ich die &lt;vcl.h&gt; inkludiert habe, wirft er mir folgende Fehlermeldung beim compilieren meines dll-quelltextes:</p>
<pre><code class="language-cpp">[Linker Fehler] Unresolved external '__fastcall Forms::TApplication::ShowException(Sysutils::Exception *)' referenced from F:\PROJECTS\LICGENDLL\SOURCE\LICGENDLL.OBJ
</code></pre>
<p>Warum?<br />
Außerdem kennt er auch eine andere importierte Funktion nicht, die ich über eine .h-datei einbinde. in anderen projekten funktioniert das jedoch ohne probleme. was ist das problem?</p>
<pre><code class="language-cpp">[Linker Fehler] Unresolved external 'GetModulePath()' referenced from F:\PROJECTS\LICGENDLL\SOURCE\LICGENDLL.OBJ
</code></pre>
<p>zur übersicht nochmal ein bisschen code:<br />
<strong>LicGenDll.cpp:</strong></p>
<pre><code class="language-cpp">#include &lt;vcl.h&gt;
#include &lt;windows.h&gt;
#pragma hdrstop

#define DLL_EXPORTS
#include &lt;Inifiles.hpp&gt;
#include &lt;stdio.h&gt;
#include &quot;WinExit.h&quot;
#include &quot;LicGenDll.h&quot;

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
    return 1;
}

DLL_FNC void GenerateLicense(TApplication* Application, TStringList* LicStr)
{
    TIniFile* LicFile;
    AnsiString FileName = AnsiString(GetModulePath());
    ...
    try{
	...
    }
    catch(Exception &amp;exception)
    {
         Application-&gt;ShowException(&amp;exception);
    }
}
</code></pre>
<p><strong>LicGenDll.h:</strong></p>
<pre><code class="language-cpp">#ifndef LicGenDllH
#define LicGenDllH

#ifdef DLL_EXPORTS                      // compile dll
  #define DLL_FNC __declspec(dllexport)
#else
  #define DLL_FNC __declspec(dllimport)    // use dll (default)
#endif

DLL_FNC void GenerateLicense(TApplication* Application, TStringList* LicStr);

#endif
</code></pre>
<p><strong>WinExit.h:</strong></p>
<pre><code class="language-cpp">#ifndef __WIN_TOOLS_INCLUDE__
#define __WIN_TOOLS_INCLUDE__

extern PCHAR GetModulePath();

#endif // __WIN_TOOLS_INCLUDE__
</code></pre>
<p>Die dazugehörige Funktion ist natürlich in &quot;WinExit.cpp&quot; definiert.</p>
<p>Freu mich wie immer auf Anregungen <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="😉"
    /><br />
Bis dahin,<br />
der oli</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/91829/externe-deklarationen-in-dll-nicht-bekannt-application-externe-funktion-linker-fehler</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 16:45:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/91829.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Nov 2004 15:31:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to externe deklarationen in dll nicht bekannt (Application, externe funktion) - linker fehler on Fri, 12 Nov 2004 15:31:35 GMT]]></title><description><![CDATA[<p>Hallo mal wieder,<br />
habe ein lustiges problem mit meiner dll. obwohl ich die &lt;vcl.h&gt; inkludiert habe, wirft er mir folgende Fehlermeldung beim compilieren meines dll-quelltextes:</p>
<pre><code class="language-cpp">[Linker Fehler] Unresolved external '__fastcall Forms::TApplication::ShowException(Sysutils::Exception *)' referenced from F:\PROJECTS\LICGENDLL\SOURCE\LICGENDLL.OBJ
</code></pre>
<p>Warum?<br />
Außerdem kennt er auch eine andere importierte Funktion nicht, die ich über eine .h-datei einbinde. in anderen projekten funktioniert das jedoch ohne probleme. was ist das problem?</p>
<pre><code class="language-cpp">[Linker Fehler] Unresolved external 'GetModulePath()' referenced from F:\PROJECTS\LICGENDLL\SOURCE\LICGENDLL.OBJ
</code></pre>
<p>zur übersicht nochmal ein bisschen code:<br />
<strong>LicGenDll.cpp:</strong></p>
<pre><code class="language-cpp">#include &lt;vcl.h&gt;
#include &lt;windows.h&gt;
#pragma hdrstop

#define DLL_EXPORTS
#include &lt;Inifiles.hpp&gt;
#include &lt;stdio.h&gt;
#include &quot;WinExit.h&quot;
#include &quot;LicGenDll.h&quot;

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
    return 1;
}

DLL_FNC void GenerateLicense(TApplication* Application, TStringList* LicStr)
{
    TIniFile* LicFile;
    AnsiString FileName = AnsiString(GetModulePath());
    ...
    try{
	...
    }
    catch(Exception &amp;exception)
    {
         Application-&gt;ShowException(&amp;exception);
    }
}
</code></pre>
<p><strong>LicGenDll.h:</strong></p>
<pre><code class="language-cpp">#ifndef LicGenDllH
#define LicGenDllH

#ifdef DLL_EXPORTS                      // compile dll
  #define DLL_FNC __declspec(dllexport)
#else
  #define DLL_FNC __declspec(dllimport)    // use dll (default)
#endif

DLL_FNC void GenerateLicense(TApplication* Application, TStringList* LicStr);

#endif
</code></pre>
<p><strong>WinExit.h:</strong></p>
<pre><code class="language-cpp">#ifndef __WIN_TOOLS_INCLUDE__
#define __WIN_TOOLS_INCLUDE__

extern PCHAR GetModulePath();

#endif // __WIN_TOOLS_INCLUDE__
</code></pre>
<p>Die dazugehörige Funktion ist natürlich in &quot;WinExit.cpp&quot; definiert.</p>
<p>Freu mich wie immer auf Anregungen <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="😉"
    /><br />
Bis dahin,<br />
der oli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/650418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/650418</guid><dc:creator><![CDATA[der oli]]></dc:creator><pubDate>Fri, 12 Nov 2004 15:31:35 GMT</pubDate></item></channel></rss>