我正在尝试编译用 flex 生成的 C 源代码。
gcc 编译器告诉我它找不到 def.h 库。
我在 lex 代码中定义了这个库:
#include "def.h"
(我从一本书中获取了 lex 源代码)
问题出在哪里?!
我正在尝试编译用 flex 生成的 C 源代码。
gcc 编译器告诉我它找不到 def.h 库。
我在 lex 代码中定义了这个库:
#include "def.h"
(我从一本书中获取了 lex 源代码)
问题出在哪里?!
(在评论中回答的问题:没有答案的问题,但在评论中解决了问题(或在聊天中扩展))
@Brian Olivier 写道:
def.h
is not part flex
。我会假设这本书有一个定义def.h
和一个def.c``. If you don't get any other errors, you may try to just leave out the #include "def.h"
。
OP 已确认:该文件在许多页之前已定义,并且仅被显式声明为用户头文件一次。