Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

Till

Alter Hase

  • »Till« ist der Autor dieses Themas

Beiträge: 378

Wohnort: Lincoln College, Oxford

Beruf: Student

  • Private Nachricht senden

1

29.03.2004, 19:14

statisches Linken an eine MFC-Anwendung

Hall mal wieder,

ich habe folgendes Problem:
Ich habe mal wieder versucht, meine 3D-Engine zu entwickeln (statische lib). Den Rahmen hab ich auch so etwa, im Test bei einer normalen Win32-Anwendung klappt's auch super.
Jetzt will ich aber eine MFC-Anwendung benutzen, aber der Linker meldet Fehler, wenn die Anwendung mit meiner Engine gelinkt wird:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Linker-Vorgang läuft...
txd.lib(txbuffer.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?
$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
txd.lib(txbuffer.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::allocator<char> con
st &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcd.lib(crt0dat.obj) : error LNK2005: _exit bereits in msvcrtd.lib(MSVCRTD.dll) definiert
libcd.lib(crt0dat.obj) : error LNK2005: __exit bereits in msvcrtd.lib(MSVCRTD.dll) definiert
libcd.lib(crt0init.obj) : error LNK2005: ___xc_z bereits in msvcrtd.lib(cinitexe.obj) definiert
libcd.lib(crt0init.obj) : error LNK2005: ___xc_a bereits in msvcrtd.lib(cinitexe.obj) definiert
libcd.lib(crt0init.obj) : error LNK2005: ___xi_z bereits in msvcrtd.lib(cinitexe.obj) definiert
libcd.lib(crt0init.obj) : error LNK2005: ___xi_a bereits in msvcrtd.lib(cinitexe.obj) definiert
libcd.lib(winxfltr.obj) : error LNK2005: __XcptFilter bereits in msvcrtd.lib(MSVCRTD.dll) definiert
libcpd.lib(ios.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$c
har_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(ios.obj) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ
) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(string.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU
?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(string.obj) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPB
DXZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(locale0.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@D
U?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(locale0.obj) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char 
const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(locale0.obj) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEP
BDXZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(locale.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::allocator<char> co
nst &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(locale.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU
?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(locale.obj) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char c
onst *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(locale.obj) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPB
DXZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(wlocale.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@D
U?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(wlocale.obj) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEP
BDXZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(wlocale.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::allocator<char> c
onst &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(wlocale.obj) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char 
const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(xlocale.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@D
U?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(xlocale.obj) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEP
BDXZ) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(xlocale.obj) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::allocator<char> c
onst &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
libcpd.lib(xlocale.obj) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char 
const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) bereits in msvcprtd.lib(MSVCP60D.dll) definiert
LINK : warning LNK4098: Standardbibliothek "msvcrtd.lib" steht in Konflikt mit anderen Bibliotheken; /NODEFAULT:Bibliothek verwenden
msvcrtd.lib(cinitexe.obj) : warning LNK4098: Standardbibliothek "libcd.lib" steht in Konflikt mit anderen Bibliotheken; /NODEFAULT:Bibliothek verwenden
libcd.lib(wwincrt0.obj) : error LNK2001: Nichtaufgeloestes externes Symbol _wWinMain@16
Debug/mfctest.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise
Fehler beim Ausführen von link.exe.

mfctest.exe - 30 Fehler, 2 Warnung(en)


Wie man sieht, benutzte ich die std::string-Klasse, doch das ist ja nicht das einzige Problem.
Was soll dieses _exit oder das ___xc_z und so????

Das scheint irgenwie am internen Linken der MFC zu liegen, denn wenn ich die Quellcodes meiner lib dem Projekt hinzufüge, und extra mitkompiliere, also nicht als fertige lib benutzte, dann klappt es!!!

Ich will aber die lib linken, OHNE dass es Fehler gibt!
Ich hoffe, ihr habt Vorschläge, ICH VERZWEIFLE!!!

Danke
DOMINVS ILLVMINATIO MEA
---
Es lebe unmanaged Code!
---
>> Meine Uni <<