简体   繁体   English

xxx.h:致命错误C1083:无法打开包含文件:'yyyy.h':没有此类文件或目录

[英]xxx.h: fatal error C1083: Cannot open include file: 'yyyy.h': No such file or directory

I am working with ac project, where I need to include a header file which has few other header files. 我正在使用ac项目,需要在其中包含一个头文件,该头文件中只有很少的其他头文件。 When I tried to compile compiler is also looking for header files included in the header file I am using. 当我尝试编译时,编译器也在寻找我正在使用的头文件中包含的头文件。

To be more clear, I am need of using xxx.h file in my current program which has only one useful function to me. 更清楚地说,我需要在当前程序中使用xxx.h文件,该文件仅对我有用。 But xxx.h file got some other yyy.h included in it. 但是xxx.h文件中包含其他一些yyy.h
When I compile I am having the below error: 编译时出现以下错误:

xxx.h : fatal error C1083: Cannot open include file: yyy.h : No such file or directory xxx.h :致命错误C1083:无法打开包含文件: yyy.h :没有此类文件或目录

Anyone can please suggest me a way to include xxx.h file and use the only one function I need with including yyy.h to my current project? 任何人都可以建议我一种方法来包括xxx.h文件,并在我当前的项目中使用我需要的唯一函数,包括yyy.h

use #ifdef blocks to prevent the unwanted headers to be included. 使用#ifdef块以防止包含不需要的标头。

Lets say you need aa prototype of a function , other than this you do not need anything. 可以说您需要一个函数原型,除此之外,您不需要任何东西。 Then : 然后 :

#ifndef MY_APP
#include <notneeded1.h>
#include <notneeded2.h>
.............
.............
#endif
#ifdef MY_APP
void my_needed_foo_bar()
#endif

#ifndef MY_APP
.....
#endif

Now compile your app with defining MY_APP 现在,通过定义MY_APP来编译您的应用

Like in gcc 像在gcc中

$gcc -DMY_APP ....

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Qt创建者错误:C1083:无法打开包含文件:&#39;xxx.h&#39;:没有此类文件或目录 - Qt-creator error: C1083: Cannot open include file: 'xxx.h': No such file or directory 严重错误C1083:无法打开包含文件:&#39;vld.h&#39;:没有此类文件或目录 - fatal error C1083: Cannot open include file: 'vld.h': No such file or directory 致命错误 C1083:无法打开包含文件:“xyz.h”:没有这样的文件或目录? - fatal error C1083: Cannot open include file: 'xyz.h': No such file or directory? 严重错误C1083:无法打开包含文件:&#39;mexutils.h&#39;:没有此类文件或目录 - fatal error C1083 : Cannot open include file: 'mexutils.h': No such file or directory 严重错误C1083:无法打开包含文件:“ Item.h”&#39;:没有此类文件或目录 - fatal error C1083: Cannot open include file: 'Item.h”': No such file or directory 致命错误 C1083:无法打开包含文件:&#39;fstream.h&#39;:没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory Microsoft Visual Studio Community 2019:致命错误 C1083:无法打开包含文件:'corecrt.h':没有这样的文件或目录 - Microsoft Visual Studio Community 2019: fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory Visual Studio 2013:致命错误C1083:无法打开包含文件:&#39;winsock2.h&#39;:没有此类文件或目录 - Visual Studio 2013: fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory Qt-C ++-致命错误C1083:无法打开包含文件:&#39;afx.h&#39; - Qt - C++ - fatal error C1083: Cannot open include file: 'afx.h' 严重错误C1083:在发布模式下无法打开包含文件:“ mysql_connection.h” - fatal error C1083: Cannot open include file: 'mysql_connection.h' in release mode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM