<?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[Problem mit Verknüpfen von Quellcodedateien]]></title><description><![CDATA[<p>Hallo erstmal, ich bin neu in dem Forum, hab schon einiges gelesen, aber nichts, das eine Antwort auf mein Problem hätte. Da ich ein blutiger Anfänger in C++ bin wollte ich mein Problem mal vorstellen. (Ich besitze das Microsoft Visual Studio 6)</p>
<p>Mein Code besteht aus 3 Dateien:</p>
<p>haupt.cpp</p>
<pre><code>#include &lt;iostream&gt;
#include &quot;h.h&quot;
using namespace std;

int main()
{
	string kette;
	cout &lt;&lt;&quot;geben sie etwas ein &quot;;
	cin &gt;&gt;kette;
	cout &lt;&lt;k(kette);
	return 0;
}
</code></pre>
<p>f.cpp</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

int k(string kette)
{
	int i =0;
	char b;
   do
	{ b = kette[i++];
	}while( b != '\0');
	return (i-1);
}
</code></pre>
<p>h.h</p>
<pre><code>#include &lt;string&gt;
using namespace std;
int k(string kette);
</code></pre>
<p>Ich habe einen Standard Arbeitsbereich erstellt.</p>
<p>Mein Problem: Ich habe exakt den gleichen Quellcode in 2 verschiedenen Projekten. (Die Projekte sind meines erachtens absolut identisch) -&gt;sie sind nur in verschiednen Ordnern</p>
<p>In dem einen Projekt kann ich den Code compillieren, in dem anderen Projekt erhalte ich 2 Fehlermeldungen beim Compillierversuch:</p>
<p>--------------------Konfiguration: haupt - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
haupt.cpp<br />
Linker-Vorgang läuft...<br />
haupt.obj : error LNK2001: Nichtaufgeloestes externes Symbol &quot;int __cdecl k(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;)&quot; (?k@@YAHV?<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi><mi>a</mi><mi>s</mi><mi>i</mi><mi>c</mi><mi mathvariant="normal">_</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi mathvariant="normal">@</mi><mi>D</mi><mi>U</mi><mo>?</mo></mrow><annotation encoding="application/x-tex">basic\_string@DU?</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.69444em;"></span><span class="strut bottom" style="height:1.00444em;vertical-align:-0.31em;"></span><span class="base textstyle uncramped"><span class="mord mathit">b</span><span class="mord mathit">a</span><span class="mord mathit">s</span><span class="mord mathit">i</span><span class="mord mathit">c</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit">s</span><span class="mord mathit">t</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">i</span><span class="mord mathit">n</span><span class="mord mathit" style="margin-right:0.03588em;">g</span><span class="mord mathrm">@</span><span class="mord mathit" style="margin-right:0.02778em;">D</span><span class="mord mathit" style="margin-right:0.10903em;">U</span><span class="mclose">?</span></span></span></span>char_traits@D@std@@V?$allocator@D@2@@std@@@Z)<br />
Debug/haupt.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise<br />
Fehler beim Ausführen von link.exe.</p>
<p>haupt.exe - 2 Fehler, 0 Warnung(en)</p>
<p>Ich bin mittlerweile total verzweifelt, da ich den Fehler nicht finde. Einmal funktioniert der Code einwandfrei und in dem anderen Projekt kann ich ihn nicht kompillieren.</p>
<p>Vielen Dank schonmal für Antworten</p>
<p>Don Quijote</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/203237/problem-mit-verknüpfen-von-quellcodedateien</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Apr 2026 22:03:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/203237.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Jan 2008 17:44:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Verknüpfen von Quellcodedateien on Sun, 20 Jan 2008 17:44:58 GMT]]></title><description><![CDATA[<p>Hallo erstmal, ich bin neu in dem Forum, hab schon einiges gelesen, aber nichts, das eine Antwort auf mein Problem hätte. Da ich ein blutiger Anfänger in C++ bin wollte ich mein Problem mal vorstellen. (Ich besitze das Microsoft Visual Studio 6)</p>
<p>Mein Code besteht aus 3 Dateien:</p>
<p>haupt.cpp</p>
<pre><code>#include &lt;iostream&gt;
#include &quot;h.h&quot;
using namespace std;

int main()
{
	string kette;
	cout &lt;&lt;&quot;geben sie etwas ein &quot;;
	cin &gt;&gt;kette;
	cout &lt;&lt;k(kette);
	return 0;
}
</code></pre>
<p>f.cpp</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

int k(string kette)
{
	int i =0;
	char b;
   do
	{ b = kette[i++];
	}while( b != '\0');
	return (i-1);
}
</code></pre>
<p>h.h</p>
<pre><code>#include &lt;string&gt;
using namespace std;
int k(string kette);
</code></pre>
<p>Ich habe einen Standard Arbeitsbereich erstellt.</p>
<p>Mein Problem: Ich habe exakt den gleichen Quellcode in 2 verschiedenen Projekten. (Die Projekte sind meines erachtens absolut identisch) -&gt;sie sind nur in verschiednen Ordnern</p>
<p>In dem einen Projekt kann ich den Code compillieren, in dem anderen Projekt erhalte ich 2 Fehlermeldungen beim Compillierversuch:</p>
<p>--------------------Konfiguration: haupt - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
haupt.cpp<br />
Linker-Vorgang läuft...<br />
haupt.obj : error LNK2001: Nichtaufgeloestes externes Symbol &quot;int __cdecl k(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;)&quot; (?k@@YAHV?<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi><mi>a</mi><mi>s</mi><mi>i</mi><mi>c</mi><mi mathvariant="normal">_</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi mathvariant="normal">@</mi><mi>D</mi><mi>U</mi><mo>?</mo></mrow><annotation encoding="application/x-tex">basic\_string@DU?</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.69444em;"></span><span class="strut bottom" style="height:1.00444em;vertical-align:-0.31em;"></span><span class="base textstyle uncramped"><span class="mord mathit">b</span><span class="mord mathit">a</span><span class="mord mathit">s</span><span class="mord mathit">i</span><span class="mord mathit">c</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit">s</span><span class="mord mathit">t</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">i</span><span class="mord mathit">n</span><span class="mord mathit" style="margin-right:0.03588em;">g</span><span class="mord mathrm">@</span><span class="mord mathit" style="margin-right:0.02778em;">D</span><span class="mord mathit" style="margin-right:0.10903em;">U</span><span class="mclose">?</span></span></span></span>char_traits@D@std@@V?$allocator@D@2@@std@@@Z)<br />
Debug/haupt.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise<br />
Fehler beim Ausführen von link.exe.</p>
<p>haupt.exe - 2 Fehler, 0 Warnung(en)</p>
<p>Ich bin mittlerweile total verzweifelt, da ich den Fehler nicht finde. Einmal funktioniert der Code einwandfrei und in dem anderen Projekt kann ich ihn nicht kompillieren.</p>
<p>Vielen Dank schonmal für Antworten</p>
<p>Don Quijote</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440061</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440061</guid><dc:creator><![CDATA[Don Quijote]]></dc:creator><pubDate>Sun, 20 Jan 2008 17:44:58 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Verknüpfen von Quellcodedateien on Sun, 20 Jan 2008 18:16:51 GMT]]></title><description><![CDATA[<blockquote>
<p>haupt.cpp<br />
Linker-Vorgang läuft...</p>
</blockquote>
<p>Da steht nichts von f.cpp, diese wird wahrscheinlich nicht richtig in das eine<br />
Projekt eingebunden sein und deshalb nicht kompiliert werden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440079</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440079</guid><dc:creator><![CDATA[Mario Sandler]]></dc:creator><pubDate>Sun, 20 Jan 2008 18:16:51 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Verknüpfen von Quellcodedateien on Sun, 20 Jan 2008 18:38:50 GMT]]></title><description><![CDATA[<p>Danke erstmal für die schnelle Antwort.</p>
<p>Mein Problem ist jetzt, dass ich beide Projekte auf exakt die gleiche Weise erstellt habe, mit dem unterschied, dass es 1x geklappt hat und dann nicht wieder.</p>
<p>Wenn die f.cpp nicht richtig eingebunden ist, wie kann ich das erreichen?</p>
<p>Edit: du hast recht, die funkton wird nicht aufgeführt. es existiert nur main. Allerdings weis ich nicht, wie ich die Quellcodedatei einbinden kann.</p>
<p>Edit2: So hab etwas rumprobiert und die Lösung gefunden.<br />
Vlt. hilft es noch anderen Leuten:</p>
<p>Projekt-&gt;Dem Projekt hinzufügen-&gt; Dateien: -&gt;-&gt;aus Liste auswählen</p>
<p>Vielen Dank für deine Hilfe <a href="http://Storm.Xapek.de" rel="nofollow">Storm.Xapek.de</a>, ohne deine Bemerkung wär ich niemals drauf gekommen. <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="🙂"
    /> <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="🙂"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440089</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440089</guid><dc:creator><![CDATA[Don Quijote]]></dc:creator><pubDate>Sun, 20 Jan 2008 18:38:50 GMT</pubDate></item></channel></rss>