错误:未知类型名称'布尔' [英] error: unknown type name ‘bool’

查看:1097
本文介绍了错误:未知类型名称'布尔'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了源代码并想编译扫描程序的文件。它产生这个错误:

pre code $ meepo @ localhost cs143-pp1 $ gcc -o lex.yy.o lex.yy. c -ll
从scanner.l包含的文件中:15:0:
scanner.h:59:5:错误:未知类型名称'bool'
从scanner.l包含的文件:16:0:
utility.h:64:38:错误:未知类型名称'bool'
utility.h:74:1:错误:未知类型名称'bool'
In文件包含在scanner.l中:17:0:
errors.h:16:18:致命错误字符串:没有这样的文件或目录
编译终止。

我尝试使用不同的编译器来编译它,但它出现了不同的错误。

  [meepo @ localhost cs143-pp1] $ g ++ -o scan lex.yy.c -ll 
/ usr / bin / ld :无法找到-ll
collect2:ld返回1退出状态

My os is 3.0- ARCH,我不知道为什么会发生这种情况。如何修复错误?

解决方案

C90不支持布尔数据类型。



C99包括它包括:

  #include< stdbool.h> 


I downloaded the source code and wanted to compile the file of scanner. It produces this error:

[meepo@localhost cs143-pp1]$ gcc -o lex.yy.o lex.yy.c -ll
In file included from scanner.l:15:0:
scanner.h:59:5: error: unknown type name ‘bool’
In file included from scanner.l:16:0:
utility.h:64:38: error: unknown type name ‘bool’
utility.h:74:1: error: unknown type name ‘bool’
In file included from scanner.l:17:0:
errors.h:16:18: fatal error: string: No such file or directory
compilation terminated.

And I tried to use different complier to compile it, but it appeared different errors.

[meepo@localhost cs143-pp1]$ g++ -o scan lex.yy.c -ll
/usr/bin/ld: cannot find -ll
collect2: ld returned 1 exit status

My os is 3.0-ARCH, I don't know why this happened. How do I fix the error?

解决方案

C90 does not support the boolean data type.

C99 does include it with this include:

#include <stdbool.h>

这篇关于错误:未知类型名称'布尔'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆