【发布时间】:2012-11-09 18:33:07
【问题描述】:
我正在尝试通过“cc -c -o”创建一个目标文件,但我得到以下语句,我应该怎么做才能解决这个问题,提前谢谢
~/hedor1>lex -t example.l > example.c
~/hedor1>cc -c -o example.o example.l
cc: example.l: linker input file unused because linking not done
生成 example.c 的第一行正在运行,我得到了 .c 文件,但是当我编写第二行时,我得到了上面的内容!
【问题讨论】:
-
编译
.c文件,而不是 lex 源代码! -
如果将此代码存储在文件 count.l 中,则可以通过 lex -t count.l > count.c cc -c -o count.o count.l cc 从中构建可执行文件-o counter count.o -ll
-
它应该像我做过一次但之后它只是显示上面的那样完成
标签: c compiler-construction compilation compiler-errors flex-lexer