0

I want to link statically libgpiod (Compiled static and dynamic) with my app. How can I force linker to link with the static version of my lib ?

I add -static -lgpiod flag but It links all libraries statically (include libc)

The following my makefile:

LIBS = -lpthread -static -lgpiod

SRCS =  ./APP/Down_app/down_app.c \
        ./APP/Uds_services/uds_services.c \
        ./ICL/uart_link.c \
        ./UDS/UDS.c \
        ./APP/gpio.c \
        ./APP/main.c

OBJS = $(SRCS:.c=.o)
EXEC = AuxMicroAccess
.PHONY: depend clean

all:    clean   $(EXEC)
        @echo Done compiling $(EXEC)

$(EXEC):    $(OBJS)
        $(CC) $(CFLAGS) $(INCLUDES) -o $(EXEC) $(OBJS) $(LFLAGS) $(LIBS) -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3
 

0 Answers0