<?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[wohin mit #includes??]]></title><description><![CDATA[<p>wohin mit #includes?!?</p>
<p>kann mir jemand erklären wo man richtigerweise includes reinmacht?<br />
wann in die header oder cpp datei und wann ins stdafx?</p>
<p>hab gerade ein problem mit CString. dafür brauch ich ja.</p>
<pre><code class="language-cpp">#include &lt;afx.h&gt;
</code></pre>
<p>wenn ich diesen include in mein file schreibe kompliert es sauber durch.<br />
wenn ich dann noch folgende zeile einfüge:</p>
<pre><code class="language-cpp">CString test[2] = {&quot;foo&quot;, &quot;bar&quot;};
</code></pre>
<p>dann bekomm ich linker fehler:</p>
<pre><code class="language-cpp">nafxcwd.lib(afxmem.obj) : error LNK2005: &quot;void * __cdecl operator new(unsigned int)&quot; (??2@YAPAXI@Z) already defined in LIBCD.lib(new.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: &quot;void __cdecl operator delete(void *)&quot; (??3@YAXPAX@Z) already defined in LIBCD.lib(dbgdel.obj)
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/foobar.exe : fatal error LNK1120: 2 unresolved externals
</code></pre>
<p>wie macht man es also richtig <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/121267/wohin-mit-includes</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 15:59:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/121267.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Sep 2005 15:03:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to wohin mit #includes?? on Wed, 21 Sep 2005 15:03:05 GMT]]></title><description><![CDATA[<p>wohin mit #includes?!?</p>
<p>kann mir jemand erklären wo man richtigerweise includes reinmacht?<br />
wann in die header oder cpp datei und wann ins stdafx?</p>
<p>hab gerade ein problem mit CString. dafür brauch ich ja.</p>
<pre><code class="language-cpp">#include &lt;afx.h&gt;
</code></pre>
<p>wenn ich diesen include in mein file schreibe kompliert es sauber durch.<br />
wenn ich dann noch folgende zeile einfüge:</p>
<pre><code class="language-cpp">CString test[2] = {&quot;foo&quot;, &quot;bar&quot;};
</code></pre>
<p>dann bekomm ich linker fehler:</p>
<pre><code class="language-cpp">nafxcwd.lib(afxmem.obj) : error LNK2005: &quot;void * __cdecl operator new(unsigned int)&quot; (??2@YAPAXI@Z) already defined in LIBCD.lib(new.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: &quot;void __cdecl operator delete(void *)&quot; (??3@YAXPAX@Z) already defined in LIBCD.lib(dbgdel.obj)
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/foobar.exe : fatal error LNK1120: 2 unresolved externals
</code></pre>
<p>wie macht man es also richtig <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/877242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/877242</guid><dc:creator><![CDATA[asr]]></dc:creator><pubDate>Wed, 21 Sep 2005 15:03:05 GMT</pubDate></item><item><title><![CDATA[Reply to wohin mit #includes?? on Wed, 21 Sep 2005 15:19:41 GMT]]></title><description><![CDATA[<p>o.k.</p>
<p>ich vermute mal dass es daran liegt, dass ich &quot;not using mfc&quot; in den project settings eingestellt habe.</p>
<p>will auch diesmal kein mfc verwenden und daher eh was anderes nehmen.</p>
<p>aber wenn noch jemand allgemein etwas zur stdafx.h und den includes zu sagen hat, dann raus damit <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/877252</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/877252</guid><dc:creator><![CDATA[asr]]></dc:creator><pubDate>Wed, 21 Sep 2005 15:19:41 GMT</pubDate></item><item><title><![CDATA[Reply to wohin mit #includes?? on Thu, 22 Sep 2005 09:16:46 GMT]]></title><description><![CDATA[<p>Du wirst wohl std::string verwenden müssen anstatt CString. Das Handling dieser Klasse ist allerdings nicht so angenehm wie bei CString.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/877639</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/877639</guid><dc:creator><![CDATA[Mathias]]></dc:creator><pubDate>Thu, 22 Sep 2005 09:16:46 GMT</pubDate></item><item><title><![CDATA[Reply to wohin mit #includes?? on Thu, 22 Sep 2005 09:33:16 GMT]]></title><description><![CDATA[<p>asr schrieb:</p>
<blockquote>
<p>ich vermute mal dass es daran liegt, dass ich &quot;not using mfc&quot; in den project settings eingestellt habe.</p>
<p>will auch diesmal kein mfc verwenden und daher eh was anderes nehmen.</p>
</blockquote>
<p>Wenn du <a href="http://VS.NET" rel="nofollow">VS.NET</a> 2003 benutzt, kannst du CString ohne die MFC benutzen:</p>
<p>#include &lt;atlstr.h&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/877650</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/877650</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Thu, 22 Sep 2005 09:33:16 GMT</pubDate></item></channel></rss>