最近有用户在编写代码的时候出现了
fatal error C1083: Cannot open include file: ‘stdbool.h’: No such file or directory
这个问题,这里我解决一下~
声明:资料来源与互联网拼凑而成!并非本人原创~,重在整理~
首先确定是否有头文件,检查方法:
用cfree-5.0 在头文件上按f12即可,如有直接跳到头文件~
vc去目录里找~
include files:
…\Microsoft Visual Studio\VC98\INCLUDE
…\Microsoft Visual Studio\VC98\MFC\INCLUDE
…\Microsoft Visual Studio\VC98\ATL\INCLUDE
如果没有添加即可~以下是头文件,在cf的include里copy的~
- /* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of GCC.
- GCC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
- GCC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place – Suite 330,
- Boston, MA 02111-1307, USA. */
- /* As a special exception, if you include this header file into source
- files compiled by GCC, this header file does not by itself cause
- the resulting executable to be covered by the GNU General Public
- License. This exception does not however invalidate any other
- reasons why the executable file might be covered by the GNU General
- Public License. */
- /*
- * ISO C Standard: 7.16 Boolean type and values <stdbool.h>
- */
- #ifndef _STDBOOL_H
- #define _STDBOOL_H
- #ifndef __cplusplus
- #define bool _Bool
- #define true 1
- #define false 0
- #else /* __cplusplus */
- /* Supporting <stdbool.h> in C++ is a GCC extension. */
- #define _Bool bool
- #define bool bool
- #define false false
- #define true true
- #endif /* __cplusplus */
- /* Signal that all the definitions are present. */
- #define __bool_true_false_are_defined 1
- #endif /* stdbool.h */
复制代码
添加后即可,如出现cl.exe丢失看下面的文章(来源互联网)
———————————————————————————————————————————————————————————————————————
Compiling… ,Error spawning cl.exe是vc6.0编译时,会遇到的一个问题。导致这个的问题有很多,
其中一种就是路径设置的问题引。“CL.exe”是VC使用真正的编译器(编译程序),其路径在“VC根
目录\VC98\Bin”下面, 你可以到相应的路径下找到这个应用程序。
解决方法:
打开vc界面 点击VC“TOOLS(工具)”—>“Option(选择)”—>“Directories(目录)”重新设置
“Excutable Fils、Include Files、Library Files、Source Files”的路径。很多情况可能就一个盘符的不同
(例如你的VC装在C,但是这些路径全部在D),改过来就OK了(注意:
要将目录设为你所使用的那个vc文件夹的目录,防止设错目录)。
如果你是按照初始路径安装vc6.0的,路径应为:
executatble files:
…\Microsoft Visual Studio\Common\MSDev98\Bin
…\Microsoft Visual Studio\VC98\BIN
…\Microsoft Visual Studio\Common\TOOLS
…\Microsoft Visual Studio\Common\TOOLS\WINNT
include files:
…\Microsoft Visual Studio\VC98\INCLUDE
…\Microsoft Visual Studio\VC98\MFC\INCLUDE
…\Microsoft Visual Studio\VC98\ATL\INCLUDE
library files:
…\Microsoft Visual Studio\VC98\LIB
…\Microsoft Visual Studio\VC98\MFC\LIB
source files:
…\Microsoft Visual Studio\VC98\MFC\SRC
…\Microsoft Visual Studio\VC98\MFC\INCLUDE
…\Microsoft Visual Studio\VC98\ATL\INCLUDE
…\Microsoft Visual Studio\VC98\CRT\SRC
———————————————————————————————————————————————————————————————————————