/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
自己编写makefile,生成.o文件的时候,忘记加选项-c。
%.o : %.c
@echo "Compilation des .c : $<"
$(CC) $(C_FLAGS) $< -o $(RWK)/$@
There is a problem here: without the -c option, gcc will compileand link. Try with this:
$(CC) $(C_FLAGS) -c $< -o $(RWK)/$@
g++ output: file not recognized: File format not recognized
解决办法:
本文介绍了一个关于Makefile编译时遇到的问题及解决方案。主要问题是由于编译命令中缺少-c选项导致gcc不仅编译了源代码还尝试进行链接操作,从而产生了错误。文章提供了正确的Makefile规则配置来避免此问题。

被折叠的 条评论
为什么被折叠?



