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

MannyDasMammut

Treue Seele

  • »MannyDasMammut« ist der Autor dieses Themas

Beiträge: 76

Wohnort: Baden - Würtemberg / Achern

Beruf: Schüler

  • Private Nachricht senden

1

28.07.2003, 10:57

102 Fehler immer wenn ich die InitWindow.h includiere !!!

Also ich hab das Buch seit 2 Tagen und ich wollte jetzt mal das Beispiel mit dem Fenster nachprogrammieren. Ich hab die InitWindow.h includiert und die und genau den Quelltext aus dem buch auf Seite 98 abgeschrieben.

Aber es ist prinzipiel egal welches Beispiel ich programmieren will. Sobald ich die InitWindow.h includiere gibts fehler das es kracht und zwar genau immer 102. :crying: Vieleicht mach ich auch was richtig blöd Falsch oder ich steh aufem schlauch aber das ist echt frustrierend

Ansonsten ist das Buch aber echt super. :huhu:

Ich kann die Fehler mal gerne Posten hier:

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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Main.cpp
STREAMS.H included TWICE
c:\tribase\include\tribase.h(79) : error C2011: 'tbResult' : 'enum' type redefinition
c:\tribase\include\tbutils.h(36) : error C2084: function 'int __cdecl tbIntRandom(const int,const int)' already has a body
c:\tribase\include\tbutils.h(37) : error C2084: function 'float __cdecl tbFloatRandom(const float,const float)' already has a body
c:\tribase\include\tbutils.h(39) : error C2572: 'tbVector2TransformCoords' : redefinition of default parameter : parameter 3
        c:\tribase\include\tbutils.h(39) : see declaration of 'tbVector2TransformCoords'
c:\tribase\include\tbutils.h(42) : error C2572: 'tbVector3TransformCoords' : redefinition of default parameter : parameter 3
        c:\tribase\include\tbutils.h(42) : see declaration of 'tbVector3TransformCoords'
c:\tribase\include\tbutils.h(60) : error C2572: 'tbLineHitsPlane' : redefinition of default parameter : parameter 4
        c:\tribase\include\tbutils.h(60) : see declaration of 'tbLineHitsPlane'
c:\tribase\include\tbutils.h(64) : error C2572: 'tbLineHitsTriangle' : redefinition of default parameter : parameter 6
        c:\tribase\include\tbutils.h(64) : see declaration of 'tbLineHitsTriangle'
c:\tribase\include\tbutils.h(66) : error C2572: 'tbLineHitsSphere' : redefinition of default parameter : parameter 5
        c:\tribase\include\tbutils.h(66) : see declaration of 'tbLineHitsSphere'
c:\tribase\include\tbutils.h(68) : error C2572: 'tbLineHitsBox' : redefinition of default parameter : parameter 4
        c:\tribase\include\tbutils.h(68) : see declaration of 'tbLineHitsBox'
c:\tribase\include\tbutils.h(69) : error C2572: 'tbLineHitsBox' : redefinition of default parameter : parameter 6
        c:\tribase\include\tbutils.h(69) : see declaration of 'tbLineHitsBox'
c:\tribase\include\tbutils.h(70) : error C2572: 'tbLineHitsModel' : redefinition of default parameter : parameter 9
        c:\tribase\include\tbutils.h(70) : see declaration of 'tbLineHitsModel'
c:\tribase\include\tbutils.h(70) : error C2572: 'tbLineHitsModel' : redefinition of default parameter : parameter 8
        c:\tribase\include\tbutils.h(70) : see declaration of 'tbLineHitsModel'
c:\tribase\include\tbutils.h(70) : error C2572: 'tbLineHitsModel' : redefinition of default parameter : parameter 7
        c:\tribase\include\tbutils.h(70) : see declaration of 'tbLineHitsModel'
c:\tribase\include\tbutils.h(70) : error C2572: 'tbLineHitsModel' : redefinition of default parameter : parameter 6
        c:\tribase\include\tbutils.h(70) : see declaration of 'tbLineHitsModel'
c:\tribase\include\tbutils.h(71) : error C2572: 'tbLineHitsOctree' : redefinition of default parameter : parameter 8
        c:\tribase\include\tbutils.h(71) : see declaration of 'tbLineHitsOctree'
c:\tribase\include\tbutils.h(71) : error C2572: 'tbLineHitsOctree' : redefinition of default parameter : parameter 7
        c:\tribase\include\tbutils.h(71) : see declaration of 'tbLineHitsOctree'
c:\tribase\include\tbutils.h(71) : error C2572: 'tbLineHitsOctree' : redefinition of default parameter : parameter 6
        c:\tribase\include\tbutils.h(71) : see declaration of 'tbLineHitsOctree'
c:\tribase\include\tbutils.h(71) : error C2572: 'tbLineHitsOctree' : redefinition of default parameter : parameter 5
        c:\tribase\include\tbutils.h(71) : see declaration of 'tbLineHitsOctree'
c:\tribase\include\tbutils.h(71) : error C2572: 'tbLineHitsOctree' : redefinition of default parameter : parameter 4
        c:\tribase\include\tbutils.h(71) : see declaration of 'tbLineHitsOctree'
c:\tribase\include\tbutils.h(79) : error C2572: 'tbModelHitsModel' : redefinition of default parameter : parameter 11
        c:\tribase\include\tbutils.h(79) : see declaration of 'tbModelHitsModel'
c:\tribase\include\tbutils.h(79) : error C2572: 'tbModelHitsModel' : redefinition of default parameter : parameter 10
        c:\tribase\include\tbutils.h(79) : see declaration of 'tbModelHitsModel'
c:\tribase\include\tbutils.h(79) : error C2572: 'tbModelHitsModel' : redefinition of default parameter : parameter 9
        c:\tribase\include\tbutils.h(79) : see declaration of 'tbModelHitsModel'
c:\tribase\include\tbutils.h(79) : error C2572: 'tbModelHitsModel' : redefinition of default parameter : parameter 8
        c:\tribase\include\tbutils.h(79) : see declaration of 'tbModelHitsModel'
c:\tribase\include\tbutils.h(79) : error C2572: 'tbModelHitsModel' : redefinition of default parameter : parameter 7
        c:\tribase\include\tbutils.h(79) : see declaration of 'tbModelHitsModel'
c:\tribase\include\tbutils.h(80) : error C2572: 'tbModelHitsOctree' : redefinition of default parameter : parameter 10
        c:\tribase\include\tbutils.h(80) : see declaration of 'tbModelHitsOctree'
c:\tribase\include\tbutils.h(80) : error C2572: 'tbModelHitsOctree' : redefinition of default parameter : parameter 9
        c:\tribase\include\tbutils.h(80) : see declaration of 'tbModelHitsOctree'
c:\tribase\include\tbutils.h(80) : error C2572: 'tbModelHitsOctree' : redefinition of default parameter : parameter 8
        c:\tribase\include\tbutils.h(80) : see declaration of 'tbModelHitsOctree'
c:\tribase\include\tbutils.h(80) : error C2572: 'tbModelHitsOctree' : redefinition of default parameter : parameter 7
        c:\tribase\include\tbutils.h(80) : see declaration of 'tbModelHitsOctree'
c:\tribase\include\tbutils.h(80) : error C2572: 'tbModelHitsOctree' : redefinition of default parameter : parameter 6
        c:\tribase\include\tbutils.h(80) : see declaration of 'tbModelHitsOctree'
c:\tribase\include\tbutils.h(80) : error C2572: 'tbModelHitsOctree' : redefinition of default parameter : parameter 5
        c:\tribase\include\tbutils.h(80) : see declaration of 'tbModelHitsOctree'
c:\tribase\include\tblist.h(28) : error C2953: 'tbListEntry' : template class has already been defined
        c:\tribase\include\tblist.h(28) : see declaration of 'tbListEntry'
c:\tribase\include\tblist.h(57) : error C2953: 'tbList' : template class has already been defined
        c:\tribase\include\tblist.h(57) : see declaration of 'tbList'
c:\tribase\include\tblist.h(65) : error C2995: 'tbList<Type>::tbList<Type>' : template function has already been defined
        c:\tribase\include\tblist.h(42) : see declaration of 'tbList<Type>::tbList<Type>'
c:\tribase\include\tblist.h(73) : error C2995: 'tbList<Type>::~tbList<Type>' : template function has already been defined
        c:\tribase\include\tblist.h(43) : see declaration of 'tbList<Type>::~tbList<Type>'
c:\tribase\include\tblist.h(109) : error C2995: 'AddEntry' : template function has already been defined
        c:\tribase\include\tblist.h(46) : see declaration of 'AddEntry'
c:\tribase\include\tblist.h(143) : error C2995: 'FindEntry' : template function has already been defined
        c:\tribase\include\tblist.h(47) : see declaration of 'FindEntry'
c:\tribase\include\tblist.h(193) : error C2995: 'DeleteEntry' : template function has already been defined
        c:\tribase\include\tblist.h(48) : see declaration of 'DeleteEntry'
c:\tribase\include\tblist.h(203) : error C2995: 'Clear' : template function has already been defined
        c:\tribase\include\tblist.h(49) : see declaration of 'Clear'
c:\tribase\include\tblist.h(228) : error C2995: 'Traverse' : template function has already been defined
        c:\tribase\include\tblist.h(50) : see declaration of 'Traverse'
c:\tribase\include\tbdynlist.h(47) : error C2953: 'tbDynList' : template class has already been defined
        c:\tribase\include\tbdynlist.h(47) : see declaration of 'tbDynList'
c:\tribase\include\tbdynlist.h(55) : error C2995: 'tbDynList<Type>::tbDynList<Type>' : template function has already been defined
        c:\tribase\include\tbdynlist.h(32) : see declaration of 'tbDynList<Type>::tbDynList<Type>'
c:\tribase\include\tbdynlist.h(63) : error C2995: 'tbDynList<Type>::~tbDynList<Type>' : template function has already been defined
        c:\tribase\include\tbdynlist.h(33) : see declaration of 'tbDynList<Type>::~tbDynList<Type>'
c:\tribase\include\tbdynlist.h(86) : error C2995: 'AddEntry' : template function has already been defined
        c:\tribase\include\tbdynlist.h(36) : see declaration of 'AddEntry'
c:\tribase\include\tbdynlist.h(104) : error C2995: 'FindEntry' : template function has already been defined
        c:\tribase\include\tbdynlist.h(37) : see declaration of 'FindEntry'
c:\tribase\include\tbdynlist.h(123) : error C2995: 'DeleteEntry' : template function has already been defined
        c:\tribase\include\tbdynlist.h(38) : see declaration of 'DeleteEntry'
c:\tribase\include\tbdynlist.h(134) : error C2995: 'Clear' : template function has already been defined
        c:\tribase\include\tbdynlist.h(39) : see declaration of 'Clear'
c:\tribase\include\tbdynlist.h(148) : error C2995: 'Traverse' : template function has already been defined
        c:\tribase\include\tbdynlist.h(40) : see declaration of 'Traverse'
c:\tribase\include\tbdynlist.h(161) : error C2995: 'Optimize' : template function has already been defined
        c:\tribase\include\tbdynlist.h(41) : see declaration of 'Optimize'
c:\tribase\include\tbvector2.h(28) : error C2011: 'tbVector2' : 'class' type redefinition
c:\tribase\include\tbvector2.h(83) : error C2084: function 'float __cdecl tbVector2Length(const class tbVector2 &)' already has a body
c:\tribase\include\tbvector2.h(84) : error C2084: function 'float __cdecl tbVector2LengthSq(const class tbVector2 &)' already has a body
c:\tribase\include\tbvector2.h(85) : error C2084: function 'class tbVector2 __cdecl tbVector2Normalize(const class tbVector2 &)' already has a body
c:\tribase\include\tbvector2.h(86) : error C2084: function 'class tbVector2 __cdecl tbVector2NormalizeEx(const class tbVector2 &)' already has a body
c:\tribase\include\tbvector2.h(87) : error C2084: function 'float __cdecl tbVector2Dot(const class tbVector2 &,const class tbVector2 &)' already has a body
c:\tribase\include\tbvector2.h(88) : error C2084: function 'float __cdecl tbVector2Angle(const class tbVector2 &,const class tbVector2 &)' already has a body
c:\tribase\include\tbvector2.h(89) : error C2084: function 'class tbVector2 __cdecl tbVector2InterpolateCoords(const class tbVector2 &,const class tbVector2 &,const float)' already has a body
c:\tribase\include\tbvector2.h(90) : error C2084: function 'class tbVector2 __cdecl tbVector2InterpolateNormal(const class tbVector2 &,const class tbVector2 &,const float)' already has a body
c:\tribase\include\tbvector2.h(91) : error C2084: function 'class tbVector2 __cdecl tbVector2Min(const class tbVector2 &,const class tbVector2 &)' already has a body
c:\tribase\include\tbvector2.h(92) : error C2084: function 'class tbVector2 __cdecl tbVector2Max(const class tbVector2 &,const class tbVector2 &)' already has a body
c:\tribase\include\tbvector2.h(93) : error C2084: function 'class tbVector2 __cdecl tbVector2Random(void)' already has a body
c:\tribase\include\tbvector3.h(28) : error C2011: 'tbVector3' : 'class' type redefinition
c:\tribase\include\tbvector3.h(88) : error C2084: function 'float __cdecl tbVector3Length(const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(89) : error C2084: function 'float __cdecl tbVector3LengthSq(const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(90) : error C2084: function 'class tbVector3 __cdecl tbVector3Normalize(const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(91) : error C2084: function 'class tbVector3 __cdecl tbVector3NormalizeEx(const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(92) : error C2084: function 'class tbVector3 __cdecl tbVector3Cross(const class tbVector3 &,const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(93) : error C2084: function 'float __cdecl tbVector3Dot(const class tbVector3 &,const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(94) : error C2084: function 'float __cdecl tbVector3Angle(const class tbVector3 &,const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(95) : error C2084: function 'class tbVector3 __cdecl tbVector3InterpolateCoords(const class tbVector3 &,const class tbVector3 &,const float)' already has a body
c:\tribase\include\tbvector3.h(96) : error C2084: function 'class tbVector3 __cdecl tbVector3InterpolateNormal(const class tbVector3 &,const class tbVector3 &,const float)' already has a body
c:\tribase\include\tbvector3.h(97) : error C2084: function 'class tbVector3 __cdecl tbVector3Min(const class tbVector3 &,const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(98) : error C2084: function 'class tbVector3 __cdecl tbVector3Max(const class tbVector3 &,const class tbVector3 &)' already has a body
c:\tribase\include\tbvector3.h(99) : error C2084: function 'class tbVector3 __cdecl tbVector3Random(void)' already has a body
c:\tribase\include\tbmatrix.h(29) : error C2011: 'tbMatrix' : 'class' type redefinition
c:\tribase\include\tbmatrix.h(205) : error C2084: function 'class tbMatrix __cdecl tbMatrixIdentity(void)' already has a body
c:\tribase\include\tbmatrix.h(218) : error C2572: 'tbMatrixCamera' : redefinition of default parameter : parameter 3
        c:\tribase\include\tbmatrix.h(218) : see declaration of 'tbMatrixCamera'
c:\tribase\include\tbplane.h(24) : error C2011: 'tbPlane' : 'class' type redefinition
c:\tribase\include\tbplane.h(65) : error C2084: function 'class tbPlane __cdecl tbPlaneNormalize(const class tbPlane &)' already has a body
c:\tribase\include\tbplane.h(65) : error C2440: 'initializing' : cannot convert from '' to 'float'
        Context does not allow for disambiguation of overloaded function
c:\tribase\include\tbplane.h(66) : error C2084: function 'float __cdecl tbPlaneDotNormal(const class tbPlane &,const class tbVector3 &)' already has a body
c:\tribase\include\tbplane.h(67) : error C2084: function 'float __cdecl tbPlaneDotCoords(const class tbPlane &,const class tbVector3 &)' already has a body
c:\tribase\include\tbplane.h(68) : error C2084: function 'class tbPlane __cdecl tbPlaneFromPointNormal(const class tbVector3 &,const class tbVector3 &)' already has a body
c:\tribase\include\tbplane.h(69) : error C2084: function 'class tbPlane __cdecl tbPlaneFromPoints(const class tbVector3 &,const class tbVector3 &,const class tbVector3 &)' already has a body
c:\tribase\include\tbcolor.h(28) : error C2011: 'tbColor' : 'class' type redefinition
c:\tribase\include\tbcolor.h(103) : error C2084: function 'class tbColor __cdecl tbColorNegate(const class tbColor &)' already has a body
c:\tribase\include\tbcolor.h(104) : error C2084: function 'float __cdecl tbColorBrightness(const class tbColor &)' already has a body
c:\tribase\include\tbcolor.h(105) : error C2084: function 'class tbColor __cdecl tbColorInterpolate(const class tbColor &,const class tbColor &,const float)' already has a body
c:\tribase\include\tbcolor.h(106) : error C2084: function 'class tbColor __cdecl tbColorMin(const class tbColor &,const class tbColor &)' already has a body
c:\tribase\include\tbcolor.h(107) : error C2084: function 'class tbColor __cdecl tbColorMax(const class tbColor &,const class tbColor &)' already has a body
c:\tribase\include\tbcolor.h(108) : error C2084: function 'class tbColor __cdecl tbColorRandom(float)' already has a body
c:\tribase\include\tbcolor.h(108) : error C2568: ':' : unable to resolve function overload
        could be 'float __cdecl tbFloatRandom(const float,const float)'
        c:\tribase\include\tbutils.h(37) : see declaration of 'tbFloatRandom'
c:\tribase\include\tbcolor.h(108) : error C2446: ':' : no conversion from 'float' to 'float (__cdecl *)(const float,const float)'
        There is no context in which this conversion is possible
c:\tribase\include\tbvfile.h(24) : error C2011: 'tbVFileSeekOrigin' : 'enum' type redefinition
c:\tribase\include\tbvfile.h(34) : error C2011: 'tbVFile' : 'class' type redefinition
c:\tribase\include\tb3dsreader.h(26) : error C2011: 'tb3DSChunkHeader' : 'struct' type redefinition
c:\tribase\include\tb3dsreader.h(34) : error C2011: 'tb3DSMaterial' : 'struct' type redefinition
c:\tribase\include\tb3dsreader.h(57) : error C2011: 'tb3DSFace' : 'struct' type redefinition
c:\tribase\include\tb3dsreader.h(77) : error C2011: 'tb3DSVertex' : 'struct' type redefinition
c:\tribase\include\tb3dsreader.h(85) : error C2011: 'tb3DSVertexEx' : 'struct' type redefinition
c:\tribase\include\tb3dsreader.h(94) : error C2011: 'tb3DSModel' : 'struct' type redefinition
c:\tribase\include\tb3dsreader.h(106) : error C2011: 'tb3DSLightType' : 'enum' type redefinition
c:\tribase\include\tb3dsreader.h(106) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.
Werde ich hier eigentlich noch gebrauch ansonsten würd ich gerne nach Hause gehen und meine graue Wand anstarren.

CodingCat

1x Contest-Sieger

Beiträge: 420

Beruf: Student (KIT)

  • Private Nachricht senden

2

28.07.2003, 11:28

Du definierst alles 2 mal. Kann es sein, dass du InitWindow schon includiert hast?
Oder du includierst eine Headerdatei in der *.cpp und in der *.h, dann nimm sie aus der *.h-Datei
alphanew.net (last updated 2011-06-26) | auf Twitter | Source Code: breeze 2 | lean C++ library | D3D Effects Lite

3

28.07.2003, 12:50

Ja du includierst irgendwas zweimal.
Beweis:
STREAMS.H included TWICE

MannyDasMammut

Treue Seele

  • »MannyDasMammut« ist der Autor dieses Themas

Beiträge: 76

Wohnort: Baden - Würtemberg / Achern

Beruf: Schüler

  • Private Nachricht senden

4

28.07.2003, 14:38

Nein eben nicht....

Das ist es ja was mich wundert ich hab nur den Text aus dem Buch abgeschrieben mehr hab ich gar nicht gemacht.
Werde ich hier eigentlich noch gebrauch ansonsten würd ich gerne nach Hause gehen und meine graue Wand anstarren.

5

28.07.2003, 14:45

ok, dann zeig mal den code her! Das würde mich ja sehr wundern!

tenschert

Frischling

Beiträge: 14

Wohnort: Stein bei Nürnberg

Beruf: Schüler

  • Private Nachricht senden

6

29.07.2003, 15:22

Ähnliches Problem?

Hi,
ich habe mir erst vor kurzem das Buch mit Begeisterung gekauft, habe aber, nach dem Installieren von DirectX9.0SDK und Kopieren aller Include und Lib-Dateien mit Schrecken festgestellt, dass keines der im Buch beschriebenen Beispielprogramme mit meinem Visual C++-6.0 Compiler funktioniert, jedesmal kommt so eine ähnliche Fehlermeldung:

--------------------Konfiguration: Joystick - Win32 Debug--------------------
Kompilierung läuft...
Joystick.cpp
Linker-Vorgang läuft...
Joystick.obj : error LNK2001: Nichtaufgeloestes externes Symbol _c_dfDIJoystick2
Joystick.obj : error LNK2001: Nichtaufgeloestes externes Symbol _DirectInput8Create@20
Joystick.obj : error LNK2001: Nichtaufgeloestes externes Symbol _IID_IDirectInput8A
LIBCD.lib(crt0.obj) : error LNK2001: Nichtaufgeloestes externes Symbol _main
Debug/Joystick.exe : fatal error LNK1120: 4 unaufgeloeste externe Verweise
Fehler beim Ausführen von link.exe.

Joystick.exe - 5 Fehler, 0 Warnung(en)

--------------------------------------------------------------------------------------

Ich habe extra die Fehlermeldung eines Beispielprogrammes von der CD, die ich mit der Tri-Base auf meinen PC kopiert habe, genommen, um jeden Tippfehler auszuschließen. C++-Programme, die nicht von diesem Buch sind, laufen alle einwandfrei, nur alle von diesem Buch haben eine ähnliche Fehlermeldung wie diese. Was kann ich dagegen tun??

Vielen Dank im Vorraus,
euer Michael Tenschert
tenschert@web.de

7

29.07.2003, 16:16

Warum postest du das in diesen Thread? Eröffne lieber einen neuen.
1. Hast du eine Win32-Anwendung erstellt oder eine Konsolenanwendung?
2. Linke dinput8.lib und dxguid.lib
Ein Gespenst geht um in Europa...

tenschert

Frischling

Beiträge: 14

Wohnort: Stein bei Nürnberg

Beruf: Schüler

  • Private Nachricht senden

8

29.07.2003, 17:16

Geht immer noch nicht

Vielen Dank für deine Mühe, aber leider geht es immer noch nicht. Ich habe zwar die beiden Dateien in alle möglichen Ordner kopiert, aber die Meldung hat sich nicht verändert. Auch, sie mit #include einzubinden, schlug fehl. Natürlich habe ich eine Win32-Anwendung erstellt(aber mit Konsolenanwendung geht's auch nicht).

Mfg
Dein Michael Tenschert
tenschert@web.de

PS: Das nächste mal werde ich einen eigenen Thread eröffnen, danke für den Hinweis!!

9

29.07.2003, 17:49

du sollst es nicht in den Ordner kopieren :-D du sollst sie linken, und zwar so:

Quellcode

1
2
#pragma comment(lib, "/*Entweder den kompletten Pfad oder nur die Datei, dann aber in den Verzeichnissen hinzufügen*/dinput8");
#pragma comment(lib, "dxguid.lib");
Ein Gespenst geht um in Europa...

tenschert

Frischling

Beiträge: 14

Wohnort: Stein bei Nürnberg

Beruf: Schüler

  • Private Nachricht senden

10

30.07.2003, 11:22

Geht immer noch nicht

Ich habe jetzt genau das gemacht was du mir gesagt hast (Vielen Dank) :huhu: , es geht aber immer noch nicht. Jetzt habe ich gleich mal den ganzen Code des ersten Programmes, dem Adapterprogramm (Listing 2.15 auf Seite 92f.) hier aufgezeigt:
--------------------------------------------------------------------------------------
#include<Windows.h>
#include<StdIO.h>
#include<d3d9.h>

#pragma comment(lib, "C:/Programme/Microsoft Visual Studio/VC98/Lib/dinput8") // ohne Verzeichnissangabe genauso
#pragma comment(lib, "C:/Programme/Microsoft Visual Studio/VC98/Lib/dxguid") // "--"

int g_iNumAdapters;
D3DADAPTER_IDENTIFIER9* g_pAdapters;
PDIRECT3D9 g_pD3D = NULL;

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
char* pcCmdLine,
int iShowCmd)
{
char acAdapterInfo[1024];

g_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
if(g_pD3D == NULL)
{

MessageBox(NULL, "Fehler beim Erzeugen der Direct3D-Schnittstelle!",
"Fehler", MB_OK | MB_ICONEXCLAMATION);
return 1;
}

g_iNumAdapters = g_pD3D -> GetAdapterCount();

g_pAdapters = new D3DADAPTER_IDENTIFIER9[g_iNumAdapters];

for(int iAdapter = 0; iAdapter < g_iNumAdapters; iAdapter++)
{
if(FAILED(g_pD3D->GetAdapterIdentifier(iAdapter, 0,
&g_pAdapters[iAdapter])))
{

MessageBox(NULL, "Adapterinformationen konnten nicht abgefragt werden!",
"Fehler", MB_OK | MB_ICONEXCLAMATION);

g_pD3D->Release();
delete[] g_pAdapters;
return 1;
}

sprintf(acAdapterInfo, "Adapter-ID: %d\n Name: %s\n Treiber: %s\n Treiberversion: %d",
iAdapter,
g_pAdapters[iAdapter].Description,
g_pAdapters[iAdapter].Driver,
g_pAdapters[iAdapter].DriverVersion);

MessageBox(NULL, acAdapterInfo, "Adapter gefunden", MB_OK | MB_ICONINFORMATION);

}

g_pD3D->Release();
delete[] g_pAdapters;

return 0;
}
-------------------------------------------------------------------------------------


Die Fehlermeldung ist wie gehabt:
--------------------Konfiguration: adapter2_15 - Win32 Debug-----------------
Kompilierung läuft...
adaper2_15.cpp
Linker-Vorgang läuft...
adaper2_15.obj : error LNK2001: Nichtaufgeloestes externes Symbol _Direct3DCreate9@4
Debug/adapter2_15.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise
Fehler beim Ausführen von link.exe.

adapter2_15.exe - 2 Fehler, 0 Warnung(en)
--------------------------------------------------------------------------------------

Nun, natürlich denkst du jetzt, dass ich dich nicht länger belästigen sollte und selber mal mich einen -oder zwei- Tage hinsetzen sollte, um das Problem zu finden. ??? Da ich aber erst ca. ein halbes Jahr mit C++ programmiere, habe ich noch nicht das große Kentniss, das du hast. Daher bitte ich dich danz lieb darum, dass du dir noch einmal die Zeit nimmst, mein Problem anzuschauen.

Vielen Dank!
Mfg.
Dein Michael Tenschert
tenschert@web.de :crying:

Werbeanzeige