I have two libraries, one is called liblits.so
, which is 32bits, another one is called liblinx.a
, which is 64bits. I need to link both of them, in my Makefile, after adding CFLAGS += "-m32"
, I got error:
skipping incompatible liblinx.a when searching for -llinx
but there was no error for liblits.so
. If I remove CFLAGS += "-m32"
(my machine is 64bits), I got error:
skipping incompatible liblits.so when searching for -llits
but there was no error for liblinx.a
. How can I link the 32bits library and 64bits library at the same time? Or do I have to have two consistent libraries?
My Makefile:
CFLAGS = -I.
CFLAGS += "-m32"
LDFLAGS = -Llinx -llinx -Llib -llits -lrt -lpthread -Wl,-R,'lib'
server:server.c
gcc -o server $(CFLAGS) $(LDFLAGS) server.c