谢谢,@JoachimPileborg。未经编辑的错误日志没有包含任何有用的东西,它应该有!该评论将我引向问题和解决方案...从我的 makefile中删除-Wfatal-errors
。
19:17 >>> gcc -Wfatal-errors main.c
main.c:2:17: error: variable or field ‘myfunction’ declared void
compilation terminated due to -Wfatal-errors.
并删除-Wfatal-errors
...
19:18 >>> gcc main.c
main.c:2:17: error: variable or field ‘myfunction’ declared void
main.c:2:17: error: ‘doesntexist’ was not declared in this scope
问题解决了。
对于那些说“为什么 -Wfatal-errors
首先使用?”的人。: 我通常不想要所有的错误,因为第一个错误会触发其余的错误。在这种情况下,看起来错误是乱序给出的,或者至少是以意外的顺序给出的——我假设编译器会首先遇到‘doesntexist’ was not declared
错误。