Hi, I am using Ubuntu16.04, with GNU make 4.1.
I was failed while built my project which referenced to libpthread and libm, 
but it was OK while used Ubuntu10.04 with GNU make 3.81.
I found the difference of the "strace make" output between the two versions of 
make, that LD will open libpthread after open libc in v3.81, but it will not 
open libpthread in v4.1, and thus I got a lot of "undefined reference to", and 
"collect2: error: ld returned 1 exit status".

Here is part of my makefile, a simple makefile:

OBJS = median.o EventParam.o Filter.o OtdrAlgo.o Otdr.o \
       OtdrEdma.o OtdrMain.o OtdrTable.o NetworkSocket.o \
       Utility.o OtdrTouch.o Event.o

CFLAGS = -g -Wall
LDFLAGS = -lm -lpthread

#CROSS_COMPILE = /opt/itop/4.3.2/bin/arm-linux-

linuxotdr: $(OBJS)
    $(CROSS_COMPILE)gcc $(CFLAGS) $(LDFLAGS) -o $@ $^

Event.o : Event.c Otdr.h prototypes.h protocol.h DspFpgaReg.h
    $(CROSS_COMPILE)gcc -c $(CFLAGS)   $^
.........

I don't know how to solve it, could you help me?
Thanks very much.





 
_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to