GCC 打印 cc1 而不是行号
当我编译程序时,gcc 给我 gcc 而不是行号,这使得查明错误变得非常困难! 怎么了?
test.c
包含:
#include "bgraph_utils.h"
int main(){
g
}
bgraph_utils.h
包含:
#include "bgraph_rep.h"
bgraph_rep.h
包含:
#include "dll_list.h"
为空
dll_list.h
每个标题 还有其他定义,但为了简洁起见,我将它们省略了
使用:gcc tets.c
编译时,出现错误:
In function ‘main’:
cc1: error: ‘g’ undeclared (first use in this function)
cc1: error: (Each undeclared identifier is reported only once
cc1: error: for each function it appears in.)
cc1: error: expected ‘;’ before ‘}’ token
if Just include bgraph_rep.h
in test .c
,行号输出正确。
When I compile a program gcc gives me gcc instead of the line numbers, making it very difficult to pinpoint errors!
What is wrong?
test.c
contains:
#include "bgraph_utils.h"
int main(){
g
}
bgraph_utils.h
contains:
#include "bgraph_rep.h"
bgraph_rep.h
contains:
#include "dll_list.h"
dll_list.h
is blank
each header had other definitions, but I have left them out for succinctness
When compiling using: gcc tets.c
, get the error:
In function ‘main’:
cc1: error: ‘g’ undeclared (first use in this function)
cc1: error: (Each undeclared identifier is reported only once
cc1: error: for each function it appears in.)
cc1: error: expected ‘;’ before ‘}’ token
if Just including bgraph_rep.h
in test.c
, line numbers are outputted correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几乎唯一一次
gcc
给我一个以cc1
开头的错误是当我向它传递一个错误标志时:这是你身上发生的事情吗?
Pretty much the only time
gcc
gives me an error starting withcc1
is when I pass it a bad flag:Is that what's happening to you?