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

1

28.03.2009, 17:53

Compiler Problem

Hallo,

tut mir Leid wenn ich so eine einfache Frage stelle aber ich versage bei so gut wie jedem Programm wo .lib oder .h Dateien eingebunden werden müssen.

Ich verwende als IDE Code::Blocks und den GNU CC Compiler.

Ich bekomme z.B. bei dem Beispiel mit dem "ersten Fenster" von der CD folgende Fehler:

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
-------------- Build: Debug in 11 ---------------

mingw32-g++.exe -Wall  -g  -Wall -g   -I"C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Include" -IC:\TriBase\Include -I"C:\Program Files\Microsoft SDKs\Windows\v6.1\Include" -I"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include"  -c "C:\Program Files (x86)\CodeBlocks\Projects\11\main.cpp" -o obj\Debug\main.o
In file included from C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/excpt.h:22,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windows.h:151,
                 from C:\Program Files (x86)\CodeBlocks\Projects\11\main.cpp:1:
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/crtdefs.h:518: error: redeclaration of C++ built-in type `short'
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/crtdefs.h:562: error: `__int64' does not name a type
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/crtdefs.h:570: error: `__time64_t' does not name a type
In file included from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:152,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windef.h:177,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windows.h:155,
                 from C:\Program Files (x86)\CodeBlocks\Projects\11\main.cpp:1:
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:79: error: `__int64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:83: error: `__int64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h: In function `void* PtrToPtr64(const void*)':
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:361: error: expected primary-expression before "void"
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:361: error: expected `)' before "void"
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:361: error: expected `)' before ';' token
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h: In function `void* Ptr64ToPtr(const void*)':
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:370: error: expected primary-expression before "void"
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:370: error: expected `)' before "void"
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:370: error: expected `)' before ';' token
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h: In function `void* HandleToHandle64(const void*)':
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:379: error: `__int64' was not declared in this scope
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:379: error: expected primary-expression before "void"
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:379: error: expected `)' before "void"
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:379: error: expected `)' before ';' token
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:379: warning: unused variable '__int64'
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h: In function `void* Handle64ToHandle(const void*)':
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:388: error: expected primary-expression before "void"
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:388: error: expected `)' before "void"
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:388: error: expected `)' before ';' token
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h: At global scope:
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:476: error: `__int64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:483: error: `__int64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/basetsd.h:484: error: `__int64' does not name a type
In file included from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windef.h:177,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windows.h:155,
                 from C:\Program Files (x86)\CodeBlocks\Projects\11\main.cpp:1:
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:289:1: warning: "_cdecl" redefined
<built-in>:83:1: warning: this is the location of the previous definition
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:290:1: warning: "__cdecl" redefined
<built-in>:79:1: warning: this is the location of the previous definition
In file included from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windef.h:177,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windows.h:155,
                 from C:\Program Files (x86)\CodeBlocks\Projects\11\main.cpp:1:
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:566: error: `__int64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:567: error: `__int64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:580: error: `__int64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:581: error: `__int64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:602: error: expected initializer before '*' token
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:603: error: expected initializer before '*' token
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:607: error: `LONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:622: error: `LONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:640: error: `ULONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:658: error: `ULONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:659: error: expected initializer before '*' token
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:786:2: #error Must define a target architecture.
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:924: error: `ULONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:925: error: `ULONGLONG' does not name a type
In file included from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/guiddef.h:146,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:930,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windef.h:177,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windows.h:155,
                 from C:\Program Files (x86)\CodeBlocks\Projects\11\main.cpp:1:
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/string.h:141: warning: ignoring #pragma warning 
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/string.h:142: warning: ignoring #pragma warning 
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/string.h:145: warning: ignoring #pragma warning 
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/string.h:266: warning: ignoring #pragma warning 
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/string.h:267: warning: ignoring #pragma warning 
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include/string.h:269: warning: ignoring #pragma warning 
In file included from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windef.h:177,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windows.h:155,
                 from C:\Program Files (x86)\CodeBlocks\Projects\11\main.cpp:1:
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:3232: warning: ignoring #pragma warning 
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:3242: warning: ignoring #pragma warning 
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:5832: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:5833: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:5836: error: `DWORD64' does not name a type
In file included from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windef.h:177,
                 from C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/windows.h:155,
                 from C:\Program Files (x86)\CodeBlocks\Projects\11\main.cpp:1:
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7590: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7591: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7592: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7593: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7600: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7602: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7603: error: `DWORD64' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7653: error: `ULONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7654: error: `ULONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7655: error: `ULONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7656: error: `ULONGLONG' does not name a type
C:/Program Files/Microsoft SDKs/Windows/v6.1/Include/winnt.h:7657: error: `ULONGLONG' does not name a type
Process terminated with status 1 (0 minutes, 10 seconds)
50 errors, 13 warnings




Folgende Sachen sind eingestellt:

Link libraries:
C:\TriBase\Lib\TriBaseD.lib


Search directories:

{

Compiler:

C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Include
C:\TriBase\Include
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include
C:\Program Files\Microsoft SDKs\Windows\v6.1\Include


Linker:

C:\TriBase\Lib
C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib
C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Lib\x64

}


Hoffe mir kann jemand helfen, denn es soll nicht direkt scheitern bevor ich überhaupt angefangen hab, denn das Buch ist wirklich toll geschrieben^^.

Mfg Woodfire

2

28.03.2009, 18:10

Hallo Woodfire,

Willkommen im Forum! ;)

Ich glaube, auf diesen Eintrag kannst du verzichten:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include

Und wenn du kein 64Bit System hast:
C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Lib\x86

Überprüf mal die Projekteinstellungen daraufhin (32/64 bit).

Ansonsten muss ich bei Code::Blocks leider passen.

3

28.03.2009, 18:17

Vielen Dank für die schnelle Antwort.

Ich besitze ein 64bit System und kann auch das Beispiel in VS kompilieren.

(Ich muss nur die .rc Datei mit #include <windows.h> ändern)


Jedoch liegt mir Code::Blocks besser weil ich damit C++ gelernt hab, jedoch auch keine Ahnung habe warum soviele Fehler kommen :\.

Ich hab die gleichen Sachen eingebunden wie in VS.


Ich denke ich werde erstmal mit VS im Buch weiterarbeiten ^^.

4

28.03.2009, 18:19

Zitat von »"Woodfire"«

Ich denke ich werde erstmal mit VS im Buch weiterarbeiten ^^.

Das ist eine gute Wahl! :)

Werbeanzeige