<?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[DLL, ergibt [LINK ERROR], Hilfe!]]></title><description><![CDATA[<p>hi, ich habe mir so eine DLL gebaut:</p>
<p>Header &quot;testlib.h&quot;</p>
<pre><code class="language-cpp">#ifdef _cplusplus
#define EXPORT extern &quot;C&quot; __declspec ( dllexport )
#else
#define EXPORT __declspec ( dllexport )
#endif

EXPORT int  Addierung( int , int );
</code></pre>
<p>die .c</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;testlib.h&quot;

int WINAPI DllMain( HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved ) {

    return true;
}

EXPORT int CALLBACK Addierung( int s1, int s2 ) {

    int summe;

    summe = s1 + s2;
    return summe;
}
</code></pre>
<p>und in meiner .cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#include &quot;testlib.h&quot;
    using namespace std;

#pragma hdrstop
#pragma argsused

int main(int argc, char* argv[]) {

    int a = 10, b = 22;

    Addierung( a, b );
    getchar();
    return 0;
}
</code></pre>
<p>das ergibt aber alles folgenden fehler:</p>
<pre><code>[Linker Error] Unresolved external 'Addierung(int, int)' referenced from C:\PROGRAMME\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
</code></pre>
<p>PS.: noch ne frage hinten dran, im tutorial von charles P. hat er in seiner dll zwei funktionen die text ausgeben sollen, diese hat er als BOOL deklariert, wieso als BOOL ??</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/177058/dll-ergibt-link-error-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 06:28:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/177058.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Mar 2007 19:05:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Tue, 27 Mar 2007 19:05:32 GMT]]></title><description><![CDATA[<p>hi, ich habe mir so eine DLL gebaut:</p>
<p>Header &quot;testlib.h&quot;</p>
<pre><code class="language-cpp">#ifdef _cplusplus
#define EXPORT extern &quot;C&quot; __declspec ( dllexport )
#else
#define EXPORT __declspec ( dllexport )
#endif

EXPORT int  Addierung( int , int );
</code></pre>
<p>die .c</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;testlib.h&quot;

int WINAPI DllMain( HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved ) {

    return true;
}

EXPORT int CALLBACK Addierung( int s1, int s2 ) {

    int summe;

    summe = s1 + s2;
    return summe;
}
</code></pre>
<p>und in meiner .cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#include &quot;testlib.h&quot;
    using namespace std;

#pragma hdrstop
#pragma argsused

int main(int argc, char* argv[]) {

    int a = 10, b = 22;

    Addierung( a, b );
    getchar();
    return 0;
}
</code></pre>
<p>das ergibt aber alles folgenden fehler:</p>
<pre><code>[Linker Error] Unresolved external 'Addierung(int, int)' referenced from C:\PROGRAMME\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
</code></pre>
<p>PS.: noch ne frage hinten dran, im tutorial von charles P. hat er in seiner dll zwei funktionen die text ausgeben sollen, diese hat er als BOOL deklariert, wieso als BOOL ??</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254112</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Tue, 27 Mar 2007 19:05:32 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Tue, 27 Mar 2007 19:08:25 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>Addierung</p>
</blockquote>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox52331" checked="true" /><label for="checkbox52331">Wort des Tages.</label></div></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254117</guid><dc:creator><![CDATA[Entenwickler]]></dc:creator><pubDate>Tue, 27 Mar 2007 19:08:25 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Tue, 27 Mar 2007 19:18:55 GMT]]></title><description><![CDATA[<p>-.- moa haette auch knut hin schreiben können... darum gehts hier aba net -.- oder is das des problem wieso ich nen linker error bkomm?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254134</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Tue, 27 Mar 2007 19:18:55 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Tue, 27 Mar 2007 19:49:40 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Was soll denn das CALLBACK da sein? Hast du die Funktion auch importiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254156</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Tue, 27 Mar 2007 19:49:40 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Tue, 27 Mar 2007 20:00:18 GMT]]></title><description><![CDATA[<blockquote>
<p>oder is das des problem wieso ich nen linker error bkomm?</p>
</blockquote>
<p>Wenn der Compiler mit --spell-verify gestartet wird ....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254161</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254161</guid><dc:creator><![CDATA[Hans_er]]></dc:creator><pubDate>Tue, 27 Mar 2007 20:00:18 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Wed, 28 Mar 2007 06:08:34 GMT]]></title><description><![CDATA[<p>in meinem tutorial stand nichts vom importieren... wie mach ich das den wenns nötig ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254260</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 28 Mar 2007 06:08:34 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Wed, 28 Mar 2007 06:47:01 GMT]]></title><description><![CDATA[<p>Erstens: Wenn du nicht irgendwo ein <code>#define CALLBACK</code> hast, dürften dort zwei unterschiedliche Aufrufkonventionen zusammenprallen.</p>
<p>Zweitens: Natürlich muß das Hauptprogramm die DLL-Funktionen <strong>im</strong>portieren, woher soll es die denn sonst bekommen? Das Importieren schaffst du, indem du &quot;__declspec(dllexport)&quot; durch &quot;__declspec(dllimport)&quot; ersetzt.</p>
<p>Und häufig sieht das so aus:</p>
<pre><code class="language-cpp">#ifdef MYDLL_IMPL
  #define MYDLL_API __declspec(dllexport)
#else
  #define MYDLL_API __declspec(dllimport)
#endif

MYDLL_API int func(int param);
</code></pre>
<p>(bei den Compiler-Einstellungen für die DLL wird &quot;MYDLL_IMPL&quot; definiert, beim Anwender-Porgramm nicht)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254284</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 28 Mar 2007 06:47:01 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Wed, 28 Mar 2007 07:12:59 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>Und häufig sieht das so aus:</p>
<pre><code class="language-cpp">#ifdef MYDLL_IMPL
  #define MYDLL_API __declspec(dllexport)
#else
  #define MYDLL_API __declspec(dllimport)
#endif
</code></pre>
</blockquote>
<p>und wo genau soll ich das hinschreiben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254300</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 28 Mar 2007 07:12:59 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Wed, 28 Mar 2007 07:13:47 GMT]]></title><description><![CDATA[<p>An den Anfang deines Headers.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254301</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254301</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 28 Mar 2007 07:13:47 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Wed, 28 Mar 2007 07:14:33 GMT]]></title><description><![CDATA[<p>ohh... ich glaub jetzt hab ich mein fehler... ich hatte vergessen die .lib ins programm zu linken...</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1254303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254303</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 28 Mar 2007 07:14:33 GMT</pubDate></item><item><title><![CDATA[Reply to DLL, ergibt [LINK ERROR], Hilfe! on Wed, 28 Mar 2007 16:12:56 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-2.html" rel="nofollow">VCL/CLX (Borland C++ Builder)</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/1254799</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1254799</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 28 Mar 2007 16:12:56 GMT</pubDate></item></channel></rss>