/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 0 has invalid symbol index 12

时间:2021-01-18 15:28:18

在我写一个makefile文件后,make一下,发现此问题,其实是链接的时候出现的错误。

$(OBJNAME):$(objects)

$(CC) -o $(OBJNAME) $(obj)   $(LIB_PATHS) $(LDFLAGS)

此时的$(obj) 是没有定义,所以就找不到.o文件,呵呵,

改成 $(objects)就好。