Bonjour, ce message fait un peu suite au message suivant :
http://www.developpez.net/forums/sho...d.php?t=246902
Donc voici mon problème : j'ai truffé mon code de
lors de la compilation, dans mon Makefile, j'ai bien mis l'option -D. Tout compile, c'est super. Sauf que j'ai maintenant des erreurs comme
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 #if defined(THREAD) faire ceci #elif defined(SEQUENTIAL) (j'ai mis #elif defined(SEQUENTIAL) et non #else car après j'intègrerais un #defined MPI) faire cela #endif
et ainsi de suite. Je remarque que ce ne sont que des fonctions mathématiques qui ne sont pas définies. Y aurait-il un pb dans mon Makefile ? Le voici../Sources/SourcesCVode_2_4_0/sundials_math.o(.text+0x88): In function `RSqrt':
sundials_math.c: undefined reference to `sqrt'
../Sources/SourcesCVode_2_4_0/sundials_math.o(.text+0x51): In function `RExp':
sundials_math.c: undefined reference to `exp'
../Sources/SourcesCVode_2_4_0/sundials_math.o(.text+0xb7): In function `RPowerR':
sundials_math.c: undefined reference to `pow'
../Sources/Mysources/functions.o(.text+0x4ea): In function `ComputeSigma2LogNormal':
functions.c: undefined reference to `log'
../Sources/Mysources/functions.o(.text+0x505):functions.c: undefined reference to `log'
../Sources/Mysources/functions.o(.text+0x538):functions.c: undefined reference to `erf'
../Sources/Mysources/functions.o(.text+0x5aa):functions.c: undefined reference to `log'
../Sources/Mysources/functions.o(.text+0x5cf):functions.c: undefined reference to `erf'
Si je dois poster une partie de mon code, dite le moi.
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 # SEQUENTIAL : sequential program # THREAD : multi-threaded program # MPI : parallel program with MPI VERSION=SEQUENTIAL # je n'ai pas encore traite le cas VERSION=MPI CC=gcc CFLAGS=-Wall -W -O2 -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Werror-implicit-function-declaration -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long -Wunreachable-code ifeq ($(VERSION),SEQUENTIAL) LDFLAGS=-Wall -O3 -lm -static endif ifeq ($(VERSION),THREAD) LDFLAGS=-Wall -O3 -lm -static -pthread endif # on inclut tous les headers INCLUDE_DIR=-I../Headers/HeadersCVode_2_4_0 -I../Headers/Myheaders # EXE contient le nom des executables a generer. EXE=out # Fichiers sources SRC= $(wildcard ../Sources/SourcesCVode_2_4_0/*.c) $(wildcard ../Sources/Mysources/*.c) # Fichiers objets le .c est remplace par un .o OBJ=$(SRC:.c=.o) %.o: %.c @$(CC) -o $@ -c $< -D$(VERSION) $(INCLUDE_DIR) $(CFLAGS) # Regles de compilation: all: $(EXE) $(EXE): $(OBJ) @$(CC) -o $@ $^ -D$(VERSION) $(LDFLAGS) clean: @rm -rfv $(EXE) $(OBJ) *~
merci.
Partager