Library not found when compiling

these two lines are the main problems:

gcc -Wall -Werror -Wextra -ggdb -I includes -c srcs/**/*.c
ar rc libmt_framework.a *.o

Suggest:

SRCS := $(WILDCARD srcs/*.c)
OBJS := $(SRCS.o:.c)

CFLAGS := -Wall -Wextra -Werror -ggdb 

NAME := libmt_framework.a

.PHONY: all
all: $(NAME)

*.o: *.c
<tab>gcc $(CFLAGS)  $< -o $@ -I./includes

$(NAME): $(OBJS)
<tab>ar -rcs $@ $^

any libraries should be referenced when creating the executable.

with something like:

$(EXECNAME): $(NEW_OBJS)
<tab>gcc -static -o $@ $^ $(LFLAGS) -LpathtoLibrary -lshortlibraryName 

Leave a Comment