<?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[Linker Fehler LNK2001]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich schon wieder :-/. Ich hab jetzt schon etliche Stunden gesucht woran es liegen kann, finde aber die Lösung nicht.</p>
<p>Ich bekomme die Fehlermeldungen</p>
<p>error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;int __stdcall AfxMessageBox(char const *,unsigned int,unsigned int)&quot; (?AfxMessageBox@@YGHPBDII@Z)&quot;.</p>
<p>und</p>
<p>error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;wchar_t * __cdecl Piece(wchar_t const *,wchar_t *,int,char,int)&quot; (?Piece@@YAPA_WPB_WPA_WHDH@Z)&quot;.</p>
<p>Die bekomme ich in mehreren Klassen. Und kann somit auch nicht wirklich sagen an welcher Codestelle es hängen könnte. Aus dem Grund verzichte ich erst mal auf das Posten von Quellcode, liefere aber natürlich gerne nach wenn jemandem das weiterhelfen würde.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/337686/linker-fehler-lnk2001</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 21:15:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/337686.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Apr 2016 08:49:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 08:49:42 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich schon wieder :-/. Ich hab jetzt schon etliche Stunden gesucht woran es liegen kann, finde aber die Lösung nicht.</p>
<p>Ich bekomme die Fehlermeldungen</p>
<p>error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;int __stdcall AfxMessageBox(char const *,unsigned int,unsigned int)&quot; (?AfxMessageBox@@YGHPBDII@Z)&quot;.</p>
<p>und</p>
<p>error LNK2001: Nicht aufgelöstes externes Symbol &quot;&quot;wchar_t * __cdecl Piece(wchar_t const *,wchar_t *,int,char,int)&quot; (?Piece@@YAPA_WPB_WPA_WHDH@Z)&quot;.</p>
<p>Die bekomme ich in mehreren Klassen. Und kann somit auch nicht wirklich sagen an welcher Codestelle es hängen könnte. Aus dem Grund verzichte ich erst mal auf das Posten von Quellcode, liefere aber natürlich gerne nach wenn jemandem das weiterhelfen würde.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493550</guid><dc:creator><![CDATA[Valyse]]></dc:creator><pubDate>Wed, 20 Apr 2016 08:49:42 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 08:59:48 GMT]]></title><description><![CDATA[<p>Was AfxMessageBox angeht...<br />
Mehrere Möglichkeiten.<br />
Wenn dein Programm aus mehreren Projekten besteht wurden vielleicht nicht alle auf Unicode umgestellt.<br />
Sonst würde ich vermuten dass es irgendwo - warum auch immer - eine eigene Deklaration von <code>AfxMessageBox</code> mit <code>const char*</code> ( <code>LPCSTR</code> ) gibt. Und diese Version von <code>AfxMessageBox</code> wird dann auch irgendwo aufgerufen.</p>
<p>Was Piece angeht, das ist wohl ne Funktion aus deinem Programm.<br />
Da werden Deklaration und Definition nicht zusammenstimmen. Also Deklaration mit <code>whcar_t</code> und Definition mit <code>char</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493551</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493551</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 20 Apr 2016 08:59:48 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 09:12:53 GMT]]></title><description><![CDATA[<p>Die Definitionen die ich von beiden habe sind</p>
<pre><code>int AFXAPI AfxMessageBox(LPCSTR lpszText, UINT nType = MB_OK,
				UINT nIDHelp = 0);
int AFXAPI AfxMessageBox(UINT nIDPrompt, UINT nType = MB_OK,
				UINT nIDHelp = (UINT)-1);
int AFXAPI AfxMessageBox(LPCWSTR lpszText, UINT nType = MB_OK,
	UINT nIDHelp = 0);
</code></pre>
<p>Und</p>
<pre><code>extern LPTSTR Piece(LPCTSTR source, wchar_t* piece, int part, char trenn, int iPieceLength=4096);
</code></pre>
<p>Ich ging jetzt davon aus das ich wchar_t oder auch char in die LP..STR geben kann.<br />
Die Umstellung des Projektes habe ich über das Projekteigenschaften Fenster gemacht, und da dann auf Unicode Zeichensatz umgestellt. Danach habe ich mich durch die Fehlerlisten gearbeitet. Natürlich will ich nicht abstreiten das mir dabei Fehler unterlaufen sind.<br />
Der Code Kompliert jetzt zwar aber wenn der Linker noch jault muss ja noch was im Argen sein. Hab ich da irgendwie eine Chance aus den Linker Fehlermeldungen rauszusuchen wo das Problem liegt, oder muss ich jeden einzelnen Aufruf der Funktionen per Hand durch gehen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493553</guid><dc:creator><![CDATA[Valyse]]></dc:creator><pubDate>Wed, 20 Apr 2016 09:12:53 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 09:27:56 GMT]]></title><description><![CDATA[<p>Ich hab jetzt noch mal geguckt was die Funktion Piece angeht. Dort wird im Code eigentlich bis auf wenige Ausnahmen immer nur ein CString übergeben.<br />
Liegt da vielleicht eins meiner Problem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493554</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493554</guid><dc:creator><![CDATA[Valyse]]></dc:creator><pubDate>Wed, 20 Apr 2016 09:27:56 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 09:41:14 GMT]]></title><description><![CDATA[<p>Korrekt wäre</p>
<pre><code class="language-cpp">int AFXAPI AfxMessageBox(
   LPCTSTR lpszText,
   UINT nType = MB_OK,
   UINT nIDHelp = 0 
);
</code></pre>
<p>Also schmeiss die <code>LPCSTR</code> und <code>LPCWSTR</code> Versionen weg und verwende statt dessen nur eine Deklaration mit <code>LPCTSTR</code> . Wieso enthält dein Programm überhaupt eigene Deklarationen für <code>AfxMessageBox</code> ?</p>
<p>Und was <code>Piece</code> angeht: Mit was das aufgerufen wird ist erstmal egal. Wie sieht die Implementierung aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493555</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493555</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 20 Apr 2016 09:41:14 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 09:46:55 GMT]]></title><description><![CDATA[<p>Wo kommt Piece her? Müsste es vielleicht extern &quot;C&quot; deklariert sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493556</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493556</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Wed, 20 Apr 2016 09:46:55 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 10:38:33 GMT]]></title><description><![CDATA[<p>Das wäre dann einmal die Funktion Piece. Das mit der Afx Fehler ist schon mal weg <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>
<pre><code>LPSTR Piece(LPCTSTR source, char* piece, int part, char trenn, int iPieceLength) {
	// Tracking
	if (theApp.m_ia.bProtocolAll)	
		Tracking(_T(&quot;$Piece(\&quot;%s\&quot;,\&quot;%c\&quot;,%d)&quot;), PIECE, source, trenn, part);

	int iMaxSource = _tcslen(source);

	//Tracking
	if ((theApp.m_ia.bProtocol)&amp;&amp;(iMaxSource&gt;iPieceLength))	
		Tracking(_T(&quot;$Piece-Fehler Größe source %d - Größe Array %d - Piece-Teil %d&quot;), PIECE, iMaxSource, iPieceLength, part);

	int so=0, de=0;

	while (part&gt;0) {

		if (source[so]==trenn||source[so]==0)
		{

			part--;

			if (part==0) 
			{

				piece[de]=0;

				return piece;
			} 

			else if (source[so]==0) 
			{
				*piece=0;
				return piece;
			} 

			else
				de=0;
		} 

		else 
		{

			piece[de]=source[so];
			de++;
		}

		so++;

	}
	return piece;                  
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2493560</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493560</guid><dc:creator><![CDATA[Valyse]]></dc:creator><pubDate>Wed, 20 Apr 2016 10:38:33 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 10:46:55 GMT]]></title><description><![CDATA[<p>Und was ist jetzt so schwer daran, die Datentypen der Parameter zu vergleichen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493561</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Wed, 20 Apr 2016 10:46:55 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 11:43:21 GMT]]></title><description><![CDATA[<p>Manchmal da gibt es sie, die Tage wo man um sich herum nur Bäume sieht und dennoch den Wald sucht :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493565</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493565</guid><dc:creator><![CDATA[Valyse]]></dc:creator><pubDate>Wed, 20 Apr 2016 11:43:21 GMT</pubDate></item><item><title><![CDATA[Reply to Linker Fehler LNK2001 on Wed, 20 Apr 2016 14:12:01 GMT]]></title><description><![CDATA[<p>Beim Prototyp:</p>
<p>`extern LPTSTR Piece(LPCTSTR source, LPTSTR piece, int part, TCHAR trenn, int iPieceLength=4096);</p>
<p>`</p>
<p>Implementierung:</p>
<p>`LPTSTR Piece(LPCTSTR source, LPTSTR piece, int part, TCHAR trenn, int iPieceLength)</p>
<p>{</p>
<p>...</p>
<p>`</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2493582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2493582</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 20 Apr 2016 14:12:01 GMT</pubDate></item></channel></rss>