<?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[error LNK2005: &amp;quot;struct ist bereits definiert&amp;quot;, trotz ifndef ??????]]></title><description><![CDATA[<p>Hallo! Ich bekomme folgenden Fehler obwohl ich die Headerdatei mit ifndef deklariert habe.</p>
<p>error LNK2005: &quot;struct benutzer * b_anfang&quot; (?b_anfang@@3PAUbenutzer@@A) ist bereits in shopsystem.obj definiert. anmeldung.obj</p>
<p>Weis jemand woran das liegt?</p>
<pre><code>#ifndef BENUTZERSTRUKTUREN_H
#define BENUTZERSTRUKTUREN_H

	#include &lt;stdio.h&gt;

	struct telefon
	{
		char vorwahl[11]; // String mit max 10 Stellen (11Byte)
		unsigned long nummer; // Int bis 4.294.967.295 (4Byte)
	};

	struct datum
	{
		char tag[3]; // String mit max 2 Stellen (3Byte)
		char monat[3]; // String mit max 2 Stellen (3Byte)
		unsigned short jahr; // Int bis 65.535 (2Byte)
	};

	struct benutzer
	{
		unsigned long benutzernu; // Int bis 4.294.967.295 (4Byte)
		char nachname[51]; // String mit max 50 Stellen (51Byte)
		char vorname[51]; // String mit max 50 Stellen (51Byte)
		char strasse[51]; // String mit max 50 Stellen (51Byte)
		char nr[6]; // String mit max 5 Stellen (6Byte)
		char ort[51]; // String mit max 50 Stellen (51Byte)
		char plz[6]; // String mit max 5 Stellen (6Byte)
		char land[51]; // String mit max 50 Stellen (51Byte)
		struct telefon festnetz;
		struct telefon handy;
		struct telefon fax;
		char email[51]; // String mit max 50 Stellen (51Byte)
		struct datum geburtstag;
		char passwort[51]; // String mit max 50 Stellen (51Byte)
		unsigned short admin; // Int bis 65.535 (2Byte)
		struct benutzer *naechster;
	};

	struct benutzer* b_anfang = NULL;
	struct benutzer* b_aktuell = NULL;
	struct benutzer* b_login = NULL;
	struct benutzer* b_suche = NULL;

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/151252/error-lnk2005-quot-struct-ist-bereits-definiert-quot-trotz-ifndef</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 05:55:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/151252.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Jun 2006 12:19:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to error LNK2005: &amp;quot;struct ist bereits definiert&amp;quot;, trotz ifndef ?????? on Sat, 24 Jun 2006 12:19:22 GMT]]></title><description><![CDATA[<p>Hallo! Ich bekomme folgenden Fehler obwohl ich die Headerdatei mit ifndef deklariert habe.</p>
<p>error LNK2005: &quot;struct benutzer * b_anfang&quot; (?b_anfang@@3PAUbenutzer@@A) ist bereits in shopsystem.obj definiert. anmeldung.obj</p>
<p>Weis jemand woran das liegt?</p>
<pre><code>#ifndef BENUTZERSTRUKTUREN_H
#define BENUTZERSTRUKTUREN_H

	#include &lt;stdio.h&gt;

	struct telefon
	{
		char vorwahl[11]; // String mit max 10 Stellen (11Byte)
		unsigned long nummer; // Int bis 4.294.967.295 (4Byte)
	};

	struct datum
	{
		char tag[3]; // String mit max 2 Stellen (3Byte)
		char monat[3]; // String mit max 2 Stellen (3Byte)
		unsigned short jahr; // Int bis 65.535 (2Byte)
	};

	struct benutzer
	{
		unsigned long benutzernu; // Int bis 4.294.967.295 (4Byte)
		char nachname[51]; // String mit max 50 Stellen (51Byte)
		char vorname[51]; // String mit max 50 Stellen (51Byte)
		char strasse[51]; // String mit max 50 Stellen (51Byte)
		char nr[6]; // String mit max 5 Stellen (6Byte)
		char ort[51]; // String mit max 50 Stellen (51Byte)
		char plz[6]; // String mit max 5 Stellen (6Byte)
		char land[51]; // String mit max 50 Stellen (51Byte)
		struct telefon festnetz;
		struct telefon handy;
		struct telefon fax;
		char email[51]; // String mit max 50 Stellen (51Byte)
		struct datum geburtstag;
		char passwort[51]; // String mit max 50 Stellen (51Byte)
		unsigned short admin; // Int bis 65.535 (2Byte)
		struct benutzer *naechster;
	};

	struct benutzer* b_anfang = NULL;
	struct benutzer* b_aktuell = NULL;
	struct benutzer* b_login = NULL;
	struct benutzer* b_suche = NULL;

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1084477</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084477</guid><dc:creator><![CDATA[spooky]]></dc:creator><pubDate>Sat, 24 Jun 2006 12:19:22 GMT</pubDate></item><item><title><![CDATA[Reply to error LNK2005: &amp;quot;struct ist bereits definiert&amp;quot;, trotz ifndef ?????? on Sat, 24 Jun 2006 12:23:15 GMT]]></title><description><![CDATA[<p>Du darfst in Header-Dateien Variablen nur deklarieren, nicht definieren. Die Definition steht dann ein einer Source-Datei.</p>
<pre><code class="language-cpp">extern struct benutzer* b_anfang;
extern struct benutzer* b_aktuell;
extern struct benutzer* b_login;
extern struct benutzer* b_suche;
</code></pre>
<p>Du darfst im übrigen Präprozessoranweisungen nicht vor dem # einrücken (laut MSDN).<br />
Und das ist C-Code, nicht C++ <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/1084481</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084481</guid><dc:creator><![CDATA[Neku]]></dc:creator><pubDate>Sat, 24 Jun 2006 12:23:15 GMT</pubDate></item><item><title><![CDATA[Reply to error LNK2005: &amp;quot;struct ist bereits definiert&amp;quot;, trotz ifndef ?????? on Sat, 24 Jun 2006 12:40:41 GMT]]></title><description><![CDATA[<p>Danke für die schnelle Antwort, aber leider klappt das noch nicht ganz... <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="😞"
    /><br />
Jetzt meckern die ganzen Funktionen aus benutzerfunktionen.h das b_anfang, b_aktuell usw nicht deklarierte Bezeichner sind... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f622.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--crying_face"
      title=":'("
      alt="😢"
    /></p>
<pre><code>#include &lt;stdio.h&gt;
#include &quot;benutzerfunktionen.h&quot;

struct benutzer* b_anfang = NULL;
struct benutzer* b_aktuell = NULL;
struct benutzer* b_login = NULL;
struct benutzer* b_suche = NULL;

void main()
{
    ...
}
</code></pre>
<pre><code>#ifndef _BENUTZERFUNKTIONEN_
#define _BENUTZERFUNKTIONEN_

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;
#include &lt;time.h&gt;
#include &lt;ctype.h&gt;
#include &lt;conio.h&gt;

#include &quot;benutzerstrukturen.h&quot;
#include &quot;grafikfunktionen.h&quot;
#define TRUE 1
#define FALSE 0

int BenutzerMenue(char *art);
int Anmeldung();
int BenutzerEinlesen(char *dateiname);
void BenutzerKopieren(struct benutzer *von_person, struct benutzer *nach_person);
void BenutzerAnhaengen(struct benutzer *tmp_person);
void BenutzerSuchenNummer(unsigned long benutzernu);
int BenutzerSuchenLogin(struct benutzer *tmp_person);
void AlleBenutzerAusgeben();
void BenutzerFree();

#endif
</code></pre>
<pre><code>#ifndef BENUTZERSTRUKTUREN_H
#define BENUTZERSTRUKTUREN_H

#include &lt;stdio.h&gt;

struct telefon
{
	char vorwahl[11]; // String mit max 10 Stellen (11Byte)
	unsigned long nummer; // Int bis 4.294.967.295 (4Byte)
};

struct datum
{
	char tag[3]; // String mit max 2 Stellen (3Byte)
	char monat[3]; // String mit max 2 Stellen (3Byte)
	unsigned short jahr; // Int bis 65.535 (2Byte)
};

struct benutzer
{
	unsigned long benutzernu; // Int bis 4.294.967.295 (4Byte)
	char nachname[51]; // String mit max 50 Stellen (51Byte)
	char vorname[51]; // String mit max 50 Stellen (51Byte)
	char strasse[51]; // String mit max 50 Stellen (51Byte)
	char nr[6]; // String mit max 5 Stellen (6Byte)
	char ort[51]; // String mit max 50 Stellen (51Byte)
	char plz[6]; // String mit max 5 Stellen (6Byte)
	char land[51]; // String mit max 50 Stellen (51Byte)
	struct telefon festnetz;
	struct telefon handy;
	struct telefon fax;
	char email[51]; // String mit max 50 Stellen (51Byte)
	struct datum geburtstag;
	char passwort[51]; // String mit max 50 Stellen (51Byte)
	unsigned short admin; // Int bis 65.535 (2Byte)
	struct benutzer *naechster;
};

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1084493</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084493</guid><dc:creator><![CDATA[spooky]]></dc:creator><pubDate>Sat, 24 Jun 2006 12:40:41 GMT</pubDate></item><item><title><![CDATA[Reply to error LNK2005: &amp;quot;struct ist bereits definiert&amp;quot;, trotz ifndef ?????? on Sat, 24 Jun 2006 12:42:32 GMT]]></title><description><![CDATA[<p>Neku schrieb:</p>
<blockquote>
<pre><code class="language-cpp">extern struct benutzer* b_anfang;
extern struct benutzer* b_aktuell;
extern struct benutzer* b_login;
extern struct benutzer* b_suche;
</code></pre>
</blockquote>
<p>Der Teil muss in der Header-Datei, um die Variablen nur zu deklarieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1084496</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084496</guid><dc:creator><![CDATA[Neku]]></dc:creator><pubDate>Sat, 24 Jun 2006 12:42:32 GMT</pubDate></item><item><title><![CDATA[Reply to error LNK2005: &amp;quot;struct ist bereits definiert&amp;quot;, trotz ifndef ?????? on Sat, 24 Jun 2006 12:51:57 GMT]]></title><description><![CDATA[<p>Hab ich gemacht... aber nun meckert er wegen Mehrfachinitialisierung! Ich verstehe das nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f622.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--crying_face"
      title=":'("
      alt="😢"
    /></p>
<blockquote>
<p>error C2374: 'b_anfang': Neudefinition; Mehrfachinitialisierung<br />
error C2374: 'b_aktuell': Neudefinition; Mehrfachinitialisierung<br />
error C2374: 'b_login': Neudefinition; Mehrfachinitialisierung<br />
error C2374: 'b_suche': Neudefinition; Mehrfachinitialisierung</p>
</blockquote>
<pre><code>#include &lt;stdio.h&gt;
#include &quot;benutzerfunktionen.h&quot;

struct benutzer* b_anfang = NULL;
struct benutzer* b_aktuell = NULL;
struct benutzer* b_login = NULL;
struct benutzer* b_suche = NULL;

void main()
{
...
}
</code></pre>
<pre><code>#ifndef BENUTZERSTRUKTUREN_H
#define BENUTZERSTRUKTUREN_H

#include &lt;stdio.h&gt;

struct telefon
{
	char vorwahl[11]; // String mit max 10 Stellen (11Byte)
	unsigned long nummer; // Int bis 4.294.967.295 (4Byte)
};

struct datum
{
	char tag[3]; // String mit max 2 Stellen (3Byte)
	char monat[3]; // String mit max 2 Stellen (3Byte)
	unsigned short jahr; // Int bis 65.535 (2Byte)
};

struct benutzer
{
	unsigned long benutzernu; // Int bis 4.294.967.295 (4Byte)
	char nachname[51]; // String mit max 50 Stellen (51Byte)
	char vorname[51]; // String mit max 50 Stellen (51Byte)
	char strasse[51]; // String mit max 50 Stellen (51Byte)
	char nr[6]; // String mit max 5 Stellen (6Byte)
	char ort[51]; // String mit max 50 Stellen (51Byte)
	char plz[6]; // String mit max 5 Stellen (6Byte)
	char land[51]; // String mit max 50 Stellen (51Byte)
	struct telefon festnetz;
	struct telefon handy;
	struct telefon fax;
	char email[51]; // String mit max 50 Stellen (51Byte)
	struct datum geburtstag;
	char passwort[51]; // String mit max 50 Stellen (51Byte)
	unsigned short admin; // Int bis 65.535 (2Byte)
	struct benutzer *naechster;
};

extern struct benutzer* b_anfang = NULL;
extern struct benutzer* b_aktuell = NULL;
extern struct benutzer* b_login = NULL;
extern struct benutzer* b_suche = NULL;

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1084507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084507</guid><dc:creator><![CDATA[spooky]]></dc:creator><pubDate>Sat, 24 Jun 2006 12:51:57 GMT</pubDate></item><item><title><![CDATA[Reply to error LNK2005: &amp;quot;struct ist bereits definiert&amp;quot;, trotz ifndef ?????? on Sat, 24 Jun 2006 12:55:05 GMT]]></title><description><![CDATA[<p>Dann such mal den Unterschied zwischen Neku's extern-Deklarationen und Deinen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1084509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084509</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sat, 24 Jun 2006 12:55:05 GMT</pubDate></item><item><title><![CDATA[Reply to error LNK2005: &amp;quot;struct ist bereits definiert&amp;quot;, trotz ifndef ?????? on Sat, 24 Jun 2006 12:57:54 GMT]]></title><description><![CDATA[<p>Danke Euch beide... da hab ich gesucht und gefunden! <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/1084516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084516</guid><dc:creator><![CDATA[spooky]]></dc:creator><pubDate>Sat, 24 Jun 2006 12:57:54 GMT</pubDate></item></channel></rss>