<?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[unresolved external symbols mit der STL... Warum?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich weiß nicht, ob dieses das korrekte Forum ist. Mein problem ist eher so ein Mischmasch von WinAPI und der STL.</p>
<p>Folgendes Szenario:</p>
<p>Ich schreibe mir gerade einen kleinen Tetris-Clone mit reiner WinAPI. Natürlich purer Terror, aber das soll jetzt mal egal sein :).</p>
<p>Die einzelnen Klötze des Tetris-Steins sind in einer Klasse gekapselt. Dann habe ich in der Stein-Klasse einen std::vector&lt;CSquare*&gt;. So weit, so gut.<br />
Die einzelnen Klötze werden dann mit ihren &quot;logischen&quot; Koordinaten per push_back in den Vektor eingefügt.</p>
<p>Der Compiler beschwehrt sich auch nicht, syntaktisch scheint das alles zu stimmen. Nur... leider meckert der Linker ein bischen rum und ich weiß nicht wieso.</p>
<pre><code>1&gt;LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1&gt;Stone.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function &quot;public: class CSquare * const &amp; __thiscall std::_Vector_const_iterator&lt;class CSquare *,class std::allocator&lt;class CSquare *&gt; &gt;::operator*(void)const &quot; (??D?$_Vector_const_iterator@PAVCSquare@@V?$allocator@PAVCSquare@@@std@@@std@@QBEABQAVCSquare@@XZ)
1&gt;libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1&gt;libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function &quot;void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &amp;,char *,int)&quot; (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
1&gt;libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function &quot;void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &amp;,char *,int)&quot; (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
</code></pre>
<p>Die Warnung ist wohl ernst zu nehmen <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="🙂"
    /><br />
Aber ich frage mich, warum ich diese ganzen Fehler bekomme. Liegt das daran, dass ich ein WinAPI Projekt habe, oder liegt es an mir?</p>
<p>Für Hilfe wäre ich dankbar.</p>
<p>Hier die Klasse CStone mit dem Vektor + Konstruktor:</p>
<pre><code class="language-cpp">// CStone.h
#include &lt;vector&gt;
#include &quot;Square.h&quot;

class CStone
{
public:
	CStone(int _id);
	~CStone(void);
private:
	std::vector&lt;CSquare*&gt; squares;
};

// CStone.cpp
CStone::CStone(int _id) :
squares()
{
	// id auswerten...
}

// Oder gibt es hier Probleme?
CStone::~CStone(void)
{
	typedef std::vector&lt;CSquare*&gt;::iterator It_PSquare;

	for (It_PSquare i = squares.begin(); i &lt; squares.end(); i++)
	{
		delete (*i);
		squares.pop_back();
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/150059/unresolved-external-symbols-mit-der-stl-warum</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Jul 2026 11:15:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/150059.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Jun 2006 16:56:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to unresolved external symbols mit der STL... Warum? on Mon, 12 Jun 2006 16:57:09 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich weiß nicht, ob dieses das korrekte Forum ist. Mein problem ist eher so ein Mischmasch von WinAPI und der STL.</p>
<p>Folgendes Szenario:</p>
<p>Ich schreibe mir gerade einen kleinen Tetris-Clone mit reiner WinAPI. Natürlich purer Terror, aber das soll jetzt mal egal sein :).</p>
<p>Die einzelnen Klötze des Tetris-Steins sind in einer Klasse gekapselt. Dann habe ich in der Stein-Klasse einen std::vector&lt;CSquare*&gt;. So weit, so gut.<br />
Die einzelnen Klötze werden dann mit ihren &quot;logischen&quot; Koordinaten per push_back in den Vektor eingefügt.</p>
<p>Der Compiler beschwehrt sich auch nicht, syntaktisch scheint das alles zu stimmen. Nur... leider meckert der Linker ein bischen rum und ich weiß nicht wieso.</p>
<pre><code>1&gt;LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1&gt;Stone.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function &quot;public: class CSquare * const &amp; __thiscall std::_Vector_const_iterator&lt;class CSquare *,class std::allocator&lt;class CSquare *&gt; &gt;::operator*(void)const &quot; (??D?$_Vector_const_iterator@PAVCSquare@@V?$allocator@PAVCSquare@@@std@@@std@@QBEABQAVCSquare@@XZ)
1&gt;libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1&gt;libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function &quot;void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &amp;,char *,int)&quot; (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
1&gt;libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function &quot;void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &amp;,char *,int)&quot; (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
</code></pre>
<p>Die Warnung ist wohl ernst zu nehmen <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="🙂"
    /><br />
Aber ich frage mich, warum ich diese ganzen Fehler bekomme. Liegt das daran, dass ich ein WinAPI Projekt habe, oder liegt es an mir?</p>
<p>Für Hilfe wäre ich dankbar.</p>
<p>Hier die Klasse CStone mit dem Vektor + Konstruktor:</p>
<pre><code class="language-cpp">// CStone.h
#include &lt;vector&gt;
#include &quot;Square.h&quot;

class CStone
{
public:
	CStone(int _id);
	~CStone(void);
private:
	std::vector&lt;CSquare*&gt; squares;
};

// CStone.cpp
CStone::CStone(int _id) :
squares()
{
	// id auswerten...
}

// Oder gibt es hier Probleme?
CStone::~CStone(void)
{
	typedef std::vector&lt;CSquare*&gt;::iterator It_PSquare;

	for (It_PSquare i = squares.begin(); i &lt; squares.end(); i++)
	{
		delete (*i);
		squares.pop_back();
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1076411</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1076411</guid><dc:creator><![CDATA[plusman]]></dc:creator><pubDate>Mon, 12 Jun 2006 16:57:09 GMT</pubDate></item><item><title><![CDATA[Reply to unresolved external symbols mit der STL... Warum? on Mon, 12 Jun 2006 17:00:26 GMT]]></title><description><![CDATA[<p>Du linkst gegen irgendeine 3rd-Party-LIB, welche mit einer anderen Einstellung bzgl. CRT erstellt wurde (also z.B: mit /MT anstelle von /MD).<br />
Also entweder Du passt Deine Anwendung an oder die LIB.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1076416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1076416</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 12 Jun 2006 17:00:26 GMT</pubDate></item><item><title><![CDATA[Reply to unresolved external symbols mit der STL... Warum? on Mon, 12 Jun 2006 17:16:27 GMT]]></title><description><![CDATA[<p>Eigentlich nicht. Habe das Projekt ganz normal erstellt und &quot;ausgebaut&quot;. An den Libs habe ich gar nichts verändert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1076436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1076436</guid><dc:creator><![CDATA[plusman]]></dc:creator><pubDate>Mon, 12 Jun 2006 17:16:27 GMT</pubDate></item></channel></rss>