Il manque le contenu des headers...Envoyé par moon93
Il manque le contenu des headers...Envoyé par moon93
Les identificateurs commençant par "_" suivi de "_A-Z" . ah j'avais cru comprendre que c'étais juste Les identificateurs commençant par "_" suivi de "A-Z" d'ou le double "__"Envoyé par Emmanuel Delahaye
Ou puis je trouver la norme sur ca ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 #ifndef H_GL_HELLO #define H_GL_HELLO void Hello(); #endif
Enfin derniére étape, as-tu un Makefile ou comment compiles tu ?
un grand makefile, dans lequel j'utilise plus les variable de chemin pasque j'avais des soucis avec / et \ sous XP er win 2000![]()
le voila!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
156
157
158
159
160
161
162
163
164
165
166
167
168 #--------------------------------------------------# # Usage # #--------------------------------------------------# # 1. Set the GCC compiler directory # # 2. Set the SDK directory # #--------------------------------------------------# # 3. Set the compiler defines # # 4. Set the executable file name (without ext.) # #--------------------------------------------------# # In the Build section # # # # 5. Set OBJ with your .o file names # # 6. Add a section for each .c to compile # #--------------------------------------------------# MKEDIR="C:\SDK\samples\sample" # # 3.4.3 # GCC_VERSION = 3.4.3 ROOT_GCC = C:\GCC_$(GCC_VERSION) # # SDK # ROOT_SDK = $(MKEDIR)\..\..\.. DEFINES = -D_EFT30_ -D_EXPORT_ DEST_NAME = SAMPLE # # 3.4.3 # GCC_EXE = $(ROOT_GCC)\BIN GCC_LIB_TYPE = thumb\soft\interwork GCC_LIB1 = $(ROOT_GCC)\arm-elf\lib\$(GCC_LIB_TYPE) GCC_LIB2 = $(ROOT_GCC)\lib\gcc\arm-elf\$(GCC_VERSION)\$(GCC_LIB_TYPE) #--------------------------------------------------# # SDK # #--------------------------------------------------# SDK_INC = C:\SDK\inc SDK_LIB = C:\SDK\lib_gnu #--------------------------------------------------# # Project # #--------------------------------------------------# PRJ_ROOT = $(MKEDIR) #--------------------------------------------------# # Source # #--------------------------------------------------# SOURCE_DIR = "$(PRJ_ROOT)\src" #--------------------------------------------------# # Object # #--------------------------------------------------# OBJ_DIR = C:\SDK\samples\sample\obj_gnu #--------------------------------------------------# # Target # #--------------------------------------------------# AXF_FILE = obj_gnu/$(DEST_NAME).AXF BIN_FILE = obj_gnu/$(DEST_NAME).BIN MAP_FILE = obj_gnu/$(DEST_NAME).MAP #--------------------------------------------------# # Compiler # #--------------------------------------------------# INCLUDES = -I "$(SDK_INC)" SYSINC = -B "$(GCC_INC)" CCOPT = -Os -Wall -Wcast-align -mthumb -mthumb-interwork -mlittle-endian -msoft-float -pipe -mcpu=arm920t -fomit-frame-pointer -fshort-enums -mstructure-size-boundary=8 -g -c COMPILE = "$(GCC_EXE)\arm-elf-gcc" $(CCOPT) $(DEFINES) $(INCLUDES) #--------------------------------------------------# # Assembler # #--------------------------------------------------# ASMOPT = -mthumb-interwork -EL -mno-fpu ASSEMBLE = "$(GCC_EXE)\arm-elf-as" $(ASMOPT) #--------------------------------------------------# # Linker # #--------------------------------------------------# LINKOPT = --script="$(SDK_LIB)\gcc_link.txt" -Map "$(MAP_FILE)" SYSOBJ = "$(SDK_LIB)\cstartup.o" "$(SDK_LIB)\trap.o" LIBS = "$(SDK_LIB)\eft30.lib" -L "$(GCC_LIB1)" -lc -L "$(GCC_LIB2)" -lgcc LINK = "$(GCC_EXE)\arm-elf-ld" ELF = "$(GCC_EXE)\arm-elf-objcopy" #--------------------------------------------------# # Build # #--------------------------------------------------# OBJ = "$(OBJ_DIR)/Entry.o" \ "$(OBJ_DIR)/Main.o" # "$(OBJ_DIR)\Del.o" #--------------------------------------------------# # Default target => request the binary file # #--------------------------------------------------# build : $(BIN_FILE) @echo Build complete #--------------------------------------------------# # Link and generate the binary file # #--------------------------------------------------# # Convert from .axf to binary $(BIN_FILE) : $(AXF_FILE) @echo Generating binary file... @cd "$(OBJ_DIR)" @$(ELF) --output-target=binary "$(AXF_FILE)" "$(BIN_FILE)" # Link $(AXF_FILE) : obj_gnu\Entry.o obj_gnu\Main.o @echo Linking... @cd "$(OBJ_DIR)" @$(LINK) -o "$(AXF_FILE)" $(LINKOPT) $(OBJ) $(SYSOBJ) $(LIBS) #--------------------------------------------------# # Recompile all the source files # #--------------------------------------------------# all : clean $(BIN_FILE) @echo Rebuild complete #--------------------------------------------------# # Clean the object files # #--------------------------------------------------# clean : @echo Cleaning... @cd "$(OBJ_DIR)" @-del $(OBJ) @-del "$(MAP_FILE)" @-del "$(AXF_FILE)" @-del "$(BIN_FILE)" #--------------------------------------------------# #--------------------------------------------------# #--------------------------------------------------# #--------------------------------------------------# #--------------------------------------------------# # Compile the source files # #--------------------------------------------------# obj_gnu\Entry.o : src\Entry.c @echo Compiling... Entry.o @cd obj_gnu @$(COMPILE) -o obj_gnu/Entry.o src/Entry.c obj_gnu\Main.o : src\Main.c @echo Compiling... Main.o @cd obj_gnu @$(COMPILE) -o obj_gnu/Main.o src/Main.c #"$(OBJ_DIR)\Del.o" : "$(SOURCE_DIR)\Del.c" # @echo Compiling... # @cd "$(OBJ_DIR)" # @$(COMPILE) "$(SOURCE_DIR)\Del.c"
a part ce warning, ça compile et ça link, mais ce qui m'enbète le plus, c que a chaque fois que je rajoute un nouveau fichier .c a mon programme jen serai obligé de modifier la makefile!!!!
y a pas moyen de faire une sorte de boucle???
merci pour votre aide
http://emmanuel-delahaye.developpez.com/notes.htm#normeEnvoyé par gnto
D'après l'Annexe A de la norme C99
or toujours dans le meme Annexe de la norme C99A.3 Preprocessing directives
(6.10) if-group:
# if constant-expression new-line
# ifdef identifier new-line groupopt
# ifndef identifier new-line groupopt
Effectivement un identificateur ca peut être "_" suivi de nondigitA.1.3 Identifiers
(6.4.2.1) identifier:
identifier-nondigit
identifier identifier-nondigit
identifier digit
(6.4.2.1) identifier-nondigit:
nondigit
universal-character-name
other implementation-defined characters
(6.4.2.1) nondigit: one of
_ a b c d e f g h i j k l m
n o p q r s t u v w x y z
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
(6.4.2.1) digit: one of
0 1 2 3 4 5 6 7 8 9
Mais ifndef peut etre suivi d'un identifier
Rien à voir. Je te parle de ça :Envoyé par gnto
ISO/IEC 9899:TC2 Committee Draft — May 6, 2005 WG14/N1124
7.1.3 Reserved identifiers
1 Each header declares or defines all identifiers listed in its associated subclause, and
optionally declares or defines identifiers listed in its associated future library directions
subclause and identifiers which are always reserved either for any use or for use as file
scope identifiers.
— All identifiers that begin with an underscore and either an uppercase letter or another
underscore are always reserved for any use.
— All identifiers that begin with an underscore are always reserved for use as identifiers
with file scope in both the ordinary and tag name spaces.
— Each macro name in any of the following subclauses (including the future library
directions) is reserved for use as specified if any of its associated headers is included;
unless explicitly stated otherwise (see 7.1.4).
— All identifiers with external linkage in any of the following subclauses (including the
future library directions) are always reserved for use as identifiers with external
linkage.157)
— Each identifier with file scope listed in any of the following subclauses (including the
future library directions) is reserved for use as a macro name and as an identifier with
file scope in the same name space if any of its associated headers is included.
2 No other identifiers are reserved. If the program declares or defines an identifier in a
context in which it is reserved (other than as allowed by 7.1.4), or defines a reserved
identifier as a macro name, the behavior is undefined.
3 If the program removes (with #undef) any macro definition of an identifier in the first
group listed above, the behavior is undefined.
j'ai l'impression de ne pas saisir le sens de cette phrase
Tous les identificateurs qui commencent avec un souligné et aussi par une lettre Majuscule ou un autre souligné sont toujours réservé pour n'importe quelle usageAll identifiers that begin with an underscore and either an uppercase letter or another
underscore are always reserved for any use.
Faut travailler ton anglais...Envoyé par gnto
Tous les identificateurs qui commencent avec un souligné suivi soit d'une lettre Majuscule soit d'un autre souligné sont toujours réservés pour n'importe quelle usage.
either .. or : ou ... ou... (Anglais de 5ème...)Envoyé par gnto
c'est toi Emmanuel qui a dis que c'est trés impoli de banaliser les discussions des autres?!!!!!!
![]()
Envoyé par moon93
![]()
Banaliser ? Tu peux expliquer ce que tu veux dire ?
vous avez changé le sujet de la discussion!!!!!!!!!!!!!!!!!![]()
Un point de la discussion a été développé, oui. C'est mal ?Envoyé par moon93
je voie pas le rapport!!!!!!! peut etre je suis trop concentré sur ma question, je vais re"voire l'enchainement des messages![]()
Et si tu prends ton programme tu le compile et link avec gcc tout simplement y'a t'il des erreurs ?
Si gcc te compile et te link correctement tu pourras p-e cibler le problème (au niveau du linker), enfin je pense![]()
Pour savoir comment faire une règle qui compile tt les sources de la meme facon
http://gl.developpez.com/tutoriel/outil/makefile/
Merci emmanuel
Partager