From 863d1b3bdc8ce5dd9d85db85165fdd08eb46170a Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Sun, 27 Nov 2011 00:34:57 +0100 Subject: [PATCH] kinect_upload_fw: specify libraries after objects in the linking command When some options, like -Wl,--as-needed, are passed to the compiler (and then to the liker) the order of linking options becomes important: libraries must be specified after the objects in the linking command. The implicit rule used was more or less: kinect_upload_fw: kinect_upload_fw.o $(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ with LDFLAGS expanded before $^ (the objects); use LDLIBS to specify the libraries instead, which is expanded after $^. More details in http://ao2.it/it/blog/2011/11/27/dont-mix-ldflags-and-ldlibs --- kinect_upload_fw/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kinect_upload_fw/Makefile b/kinect_upload_fw/Makefile index 22074c9..2cca6fd 100644 --- a/kinect_upload_fw/Makefile +++ b/kinect_upload_fw/Makefile @@ -34,7 +34,7 @@ CFLAGS += -fno-common \ -Wwrite-strings CFLAGS += $(shell pkg-config --cflags libusb-1.0) -LDFLAGS += $(shell pkg-config --libs libusb-1.0) +LDLIBS += $(shell pkg-config --libs libusb-1.0) PREFIX ?= /usr/local bindir := $(PREFIX)/sbin -- 2.1.4