From `man gcc`:

It makes a difference where in the command you write this option; the linker
searches and processes libraries and object files in the order they are
specified.  Thus, foo.o -lz bar.o searches library z after file foo.o but before
bar.o.  If bar.o refers to functions in z, those functions may not be loaded.
This commit is contained in:
King Kévin 2021-02-17 09:49:02 +01:00
parent 7fc06171d9
commit 2c4772ce53
1 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ CFLAGS += -fno-common -ffunction-sections -fdata-sections
all: u2_usb u2_bt
u2_usb: u2_usb.c
gcc ${CFLAGS} -lhidapi-libusb -o $@ $<
gcc ${CFLAGS} `pkg-config --cflags hidapi-libusb` -o $@ $< `pkg-config --libs hidapi-libusb`
u2_bt: u2_bt.c
gcc ${CFLAGS} `pkg-config --cflags dbus-1` `pkg-config --libs dbus-1` -o $@ $<
gcc ${CFLAGS} `pkg-config --cflags dbus-1` -o $@ $< `pkg-config --libs dbus-1`