<?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[Headerdatei einbinden in DLL]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich komme hier einfach nicht mehr. Würde mich sehr freuen, wenn mir jemand weiterhelfen könnte.</p>
<p>Ich habe ein Programm in der Konsole geschrieben und getestet - es hat soweit alles funktioniert.</p>
<p>Nun will ich aus den Header- und Programmdateien eine DLL-Projekt machen.<br />
Es kommen dann eine unmenge Fehler:</p>
<pre><code>Bibliothek Debug/PavisS7.lib und Objekt Debug/PavisS7.exp wird erstellt
PavisS7.exp : warning LNK4070: Die Direktive /OUT:PacisBackup.dll in .EXP weicht vom Ausgabedateinamen &quot;Debug/PavisS7.dll&quot; ab; Direktive wird ignoriert
Download.obj : error LNK2001: Nichtaufgeloestes externes Symbol _send@16
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _send@16
QueryBlocks.obj : error LNK2001: Nichtaufgeloestes externes Symbol _send@16
Upload.obj : error LNK2001: Nichtaufgeloestes externes Symbol _send@16
Download.obj : error LNK2001: Nichtaufgeloestes externes Symbol _htons@4
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _htons@4
QueryBlocks.obj : error LNK2001: Nichtaufgeloestes externes Symbol _htons@4
Upload.obj : error LNK2001: Nichtaufgeloestes externes Symbol _htons@4
Download.obj : error LNK2001: Nichtaufgeloestes externes Symbol _recv@16
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _recv@16
QueryBlocks.obj : error LNK2001: Nichtaufgeloestes externes Symbol _recv@16
Upload.obj : error LNK2001: Nichtaufgeloestes externes Symbol _recv@16
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _connect@12
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _inet_addr@4
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _WSACleanup@0
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _WSAGetLastError@0
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _socket@12
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _WSAStartup@8
Debug/PavisS7.dll : fatal error LNK1120: 9 unaufgeloeste externe Verweise
Fehler beim Ausführen von link.exe.

PavisS7.dll - 19 Fehler, 10 Warnung(en)
</code></pre>
<p>Hier noch ein kleiner Codeausschnitt:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;Download.h&quot;
#include &quot;Initialization.h&quot;
#include &quot;Upload.h&quot;
#include &quot;QueryBlocks.h&quot;

// Exportierte Funktionen
int _stdcall QueryBlocks(char*,unsigned char ,unsigned char , unsigned char ,unsigned char,unsigned char ,unsigned char );

BOOL WINAPI DllEntryPoint ( HINSTANCE hDLL, DWORD dwREASON, LPVOID Reserved )
{
    switch (dwREASON)
    { 
        case DLL_PROCESS_ATTACH: { break; }		
        case DLL_PROCESS_DETACH: { break; } 		 
    }
    return TRUE;
}

int _stdcall QueryBlocks(char* strIpPCU,unsigned char bytSlotNrPCU,unsigned char bytRackNrPCU, unsigned char abyteBlocksDB[],unsigned char abyteBlocksFB[],unsigned char abyteBlocksFC[],unsigned char abyteBlocksOB[])
{
return 1;
}
</code></pre>
<p>So sieht z.B. die Headerdatei Initialization aus</p>
<pre><code class="language-cpp">#ifndef INITIALIZATION_H
#define INITIALIZATION_H

#include &lt;windows.h&gt;
#include &lt;winsock.h&gt;
#include &lt;iostream&gt;

// Fehlercodes
#define CONNECTION_ERROR 0001
#define CONNECTED 1111

class cInitialization
{
public:
	int fConnectToPlc(char chIpAddress[], unsigned char bytSlotNumber, unsigned char bytRackNumber);
	static SOCKET ConnectSocket;
private:
//	static char chIpAddress[15]; 
	static int uErrorCode;
	static unsigned char bytRackNumber;
	static unsigned char bytSlotNumber;

private:
	int fConnectToPlcRecive();

};

#endif INITIALIZATION_H
</code></pre>
<p>Vielen Dank im voraus<br />
Gruß Tupo13</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/132337/headerdatei-einbinden-in-dll</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 06:19:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/132337.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Jan 2006 07:37:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Headerdatei einbinden in DLL on Tue, 10 Jan 2006 07:42:17 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich komme hier einfach nicht mehr. Würde mich sehr freuen, wenn mir jemand weiterhelfen könnte.</p>
<p>Ich habe ein Programm in der Konsole geschrieben und getestet - es hat soweit alles funktioniert.</p>
<p>Nun will ich aus den Header- und Programmdateien eine DLL-Projekt machen.<br />
Es kommen dann eine unmenge Fehler:</p>
<pre><code>Bibliothek Debug/PavisS7.lib und Objekt Debug/PavisS7.exp wird erstellt
PavisS7.exp : warning LNK4070: Die Direktive /OUT:PacisBackup.dll in .EXP weicht vom Ausgabedateinamen &quot;Debug/PavisS7.dll&quot; ab; Direktive wird ignoriert
Download.obj : error LNK2001: Nichtaufgeloestes externes Symbol _send@16
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _send@16
QueryBlocks.obj : error LNK2001: Nichtaufgeloestes externes Symbol _send@16
Upload.obj : error LNK2001: Nichtaufgeloestes externes Symbol _send@16
Download.obj : error LNK2001: Nichtaufgeloestes externes Symbol _htons@4
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _htons@4
QueryBlocks.obj : error LNK2001: Nichtaufgeloestes externes Symbol _htons@4
Upload.obj : error LNK2001: Nichtaufgeloestes externes Symbol _htons@4
Download.obj : error LNK2001: Nichtaufgeloestes externes Symbol _recv@16
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _recv@16
QueryBlocks.obj : error LNK2001: Nichtaufgeloestes externes Symbol _recv@16
Upload.obj : error LNK2001: Nichtaufgeloestes externes Symbol _recv@16
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _connect@12
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _inet_addr@4
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _WSACleanup@0
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _WSAGetLastError@0
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _socket@12
Initialization.obj : error LNK2001: Nichtaufgeloestes externes Symbol _WSAStartup@8
Debug/PavisS7.dll : fatal error LNK1120: 9 unaufgeloeste externe Verweise
Fehler beim Ausführen von link.exe.

PavisS7.dll - 19 Fehler, 10 Warnung(en)
</code></pre>
<p>Hier noch ein kleiner Codeausschnitt:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;Download.h&quot;
#include &quot;Initialization.h&quot;
#include &quot;Upload.h&quot;
#include &quot;QueryBlocks.h&quot;

// Exportierte Funktionen
int _stdcall QueryBlocks(char*,unsigned char ,unsigned char , unsigned char ,unsigned char,unsigned char ,unsigned char );

BOOL WINAPI DllEntryPoint ( HINSTANCE hDLL, DWORD dwREASON, LPVOID Reserved )
{
    switch (dwREASON)
    { 
        case DLL_PROCESS_ATTACH: { break; }		
        case DLL_PROCESS_DETACH: { break; } 		 
    }
    return TRUE;
}

int _stdcall QueryBlocks(char* strIpPCU,unsigned char bytSlotNrPCU,unsigned char bytRackNrPCU, unsigned char abyteBlocksDB[],unsigned char abyteBlocksFB[],unsigned char abyteBlocksFC[],unsigned char abyteBlocksOB[])
{
return 1;
}
</code></pre>
<p>So sieht z.B. die Headerdatei Initialization aus</p>
<pre><code class="language-cpp">#ifndef INITIALIZATION_H
#define INITIALIZATION_H

#include &lt;windows.h&gt;
#include &lt;winsock.h&gt;
#include &lt;iostream&gt;

// Fehlercodes
#define CONNECTION_ERROR 0001
#define CONNECTED 1111

class cInitialization
{
public:
	int fConnectToPlc(char chIpAddress[], unsigned char bytSlotNumber, unsigned char bytRackNumber);
	static SOCKET ConnectSocket;
private:
//	static char chIpAddress[15]; 
	static int uErrorCode;
	static unsigned char bytRackNumber;
	static unsigned char bytSlotNumber;

private:
	int fConnectToPlcRecive();

};

#endif INITIALIZATION_H
</code></pre>
<p>Vielen Dank im voraus<br />
Gruß Tupo13</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962367</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962367</guid><dc:creator><![CDATA[Tupo13]]></dc:creator><pubDate>Tue, 10 Jan 2006 07:42:17 GMT</pubDate></item><item><title><![CDATA[Reply to Headerdatei einbinden in DLL on Tue, 10 Jan 2006 07:54:46 GMT]]></title><description><![CDATA[<p>Ok Tut mir leid - Sorry</p>
<p>Ich habe vergessen die ws2_32.lib einzubinden ich Idiot.</p>
<p>Ich hätte da aber noch eine weitere Frage:</p>
<p>ich habe z.B. eine Klasse <strong>cTest</strong></p>
<p>ein Objekt der Klasse erzeuge ich dann doch so:</p>
<pre><code class="language-cpp">cTest t1;
</code></pre>
<p>und Verwenden tu ich es doch dann z.B. so</p>
<pre><code class="language-cpp">t1.Test();
</code></pre>
<p>Dann bekomme ich aber immer folgende Warnung:</p>
<pre><code>:\paviss7\test.cpp(581) : warning C4101: 't1' : Unreferenzierte lokale Variable
</code></pre>
<p>Woran liegt das? ich kann dem Objekt beim erzeugen doch keinen Wert zuweisen - oder doch?</p>
<p>Gruß Tupo13</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962375</guid><dc:creator><![CDATA[Tupo13]]></dc:creator><pubDate>Tue, 10 Jan 2006 07:54:46 GMT</pubDate></item><item><title><![CDATA[Reply to Headerdatei einbinden in DLL on Tue, 10 Jan 2006 08:00:06 GMT]]></title><description><![CDATA[<p>Die Warnung bedeutet, daß deine Variable 't1' zwar deklariert, aber nicht verwendet wird (also stuft der Compiler sie als überflüssig ein). Kannst du mal den Zusammenhang posten, in dem sie auftaucht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962379</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 10 Jan 2006 08:00:06 GMT</pubDate></item><item><title><![CDATA[Reply to Headerdatei einbinden in DLL on Tue, 10 Jan 2006 08:20:10 GMT]]></title><description><![CDATA[<p>@ CStoll<br />
danke für deine Antwort:</p>
<p>also eine Funktion der DLL sieht z.B. so aus:</p>
<pre><code class="language-cpp">int _stdcall QueryBlocks(char* strIpPCU,unsigned char bytSlotNrPCU,unsigned char bytRackNrPCU, unsigned char abyteBlocksDB[],unsigned char abyteBlocksFB[],unsigned char abyteBlocksFC[],unsigned char abyteBlocksOB[])
{
int iretVal;

cInitialization i1;
i1.fConnectToPlc(strIpPCU,bytSlotNrPCU,bytRackNrPCU);

cQueryBlocks q1;
iretVal = q1.fDoQueryBlocks(&amp;abyteBlocksDB[0],&amp;abyteBlocksFB[0],&amp;abyteBlocksFC[0],&amp;abyteBlocksOB[0]);

return iretVal;
}
</code></pre>
<p>Hier bekomme ich dann für q1 und i1 diesen Fehler:<br />
q1 und i1 werden sonst niergends verwendet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962391</guid><dc:creator><![CDATA[Tupo13]]></dc:creator><pubDate>Tue, 10 Jan 2006 08:20:10 GMT</pubDate></item><item><title><![CDATA[Reply to Headerdatei einbinden in DLL on Tue, 10 Jan 2006 10:31:17 GMT]]></title><description><![CDATA[<p>Das ist kein Fehler, nur eine Warnung <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>
<p>Kann es eventuell sein, daß du dort nur statische Methoden von i1 bzw. q1 aufrufst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962500</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Tue, 10 Jan 2006 10:31:17 GMT</pubDate></item></channel></rss>