Compilation via Makefile sur OS X
Bonjour,
je viens poster ici sans être certain que c'est le bon endroit.
Je souhaite compiler avec un Makefile plusieurs fichier C, je crée également une lib.a est c'est à ce moment que le problème se pose .
Sur linux tout fonctionne sans problèmes par contre sur OS X, je suis confronté à l'erreur suivante :
Code:
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
| "ld: warning: ignoring file libmy.a, file was built for archive which is not the architecture being linked (i386): libmy.a
Undefined symbols for architecture i386:
"_free_tab", referenced from:
_minishell in minishell-0fd57d.o
"_getarg", referenced from:
_manage_process in minishell-0fd57d.o
"_getcmd", referenced from:
_manage_process in minishell-0fd57d.o
(maybe you meant: _getcmd_space)
"_mal_tab", referenced from:
_minishell in minishell-0fd57d.o
_main in minishell-0fd57d.o
"_my_cd", referenced from:
_builtins in minishell-0fd57d.o
"_my_concat", referenced from:
_manage_process in minishell-0fd57d.o
"_my_putchar", referenced from:
_builtins in minishell-0fd57d.o
"_my_putstr", referenced from:
_builtins in minishell-0fd57d.o
"_my_strstr", referenced from:
_builtins in minishell-0fd57d.o
"_signal_exit", referenced from:
_minishell in minishell-0fd57d.o
ld: symbol(s) not found for architecture i386" |
voici mon Makefile:
Code:
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
| SRC= lib/minishell.c \
lib/my_cd.c \
lib/getarg.c \
lib/getcmd.c \
lib/str.c \
lib/malloc_and_free_funct.c \
lib/primary_funct.c \
lib/str2.c \
lib/my_env.c
CC= gcc -c
libmy= ar rc libmy.a
CREATE= ranlib libmy.a
EX=gcc lib/minishell.c -o $(NAME) -g -m32 -Wall -Wconversion -Wshorten-64-to-32
OBJ= $(SRC:.c=.o)
NAME= mysh
all: $(NAME)
$(NAME): $(OBJ)
$(CC) $(SRC)
$(libmy) $(OBJ)
$(CREATE)
$(EX) libmy.a
clean:
rm $(OBJ)
fclean: clean
rm $(NAME)
re: fclean all |
si j'ais bien suivis c'est un problème d'architecture qui ne sont pas identiques, ducoup la libmy.a ne passe pas..
j'ai déjà essayer avec différents flags de compiler mais rien à faire .
Si vous avez une idée je vous en serrait reconnaissant , merci