0

Here is my makefile:

NAME = libftprintf.a

SRCS =  ft_printf.c \
        ft_hexadecimal_fd.c \
        ft_putchar_fd.c \
        ft_putnbr_fd.c \
        ft_putstr_fd.c
        
OBJS = $(SRCS:.c=.o)

CC = gcc
FLAGS = -Wall -Werror -Wextra

all: $(NAME)

$(NAME): $(OBJS)
    ar rcs $(NAME) $(OBJS)
    
%.o: %.c
    $(CC) $(FLAGS) -c $<
    
clean:
    rm -f $(OBJS)
    
fclean: clean
    rm -f $(NAME)  
    
re: fclean $(NAME)

.PHONY: all clean fclean re

I was expecting to be able to execute ./libftprintf.a to run my program but instead i get the following: zsh: permission denied: ./libftprintf.a

Aiert B
  • 1
  • 1
  • 1
    `libfprintf.a` is a library. It's not a program. You can't run a library. – MadScientist Nov 23 '22 at 13:49
  • To execute a program in that way, it needs the x-bit to be set. Did you check this (`stat libfprintf.a`)? Having said this, a filename ending in `.a` is a very unusual name for a program. Are you sure that it is an exeutable program? Do a `file libfprintf.a` to see what you really have here. – user1934428 Nov 23 '22 at 14:11

0 Answers0