标题已添加但未被识别 [英] Header Added but is not Recognized

查看:109
本文介绍了标题已添加但未被识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我将头文件添加到控制台应用程序项目中。我可以在解决方案资源管理器中看到头文件(在头文件部分中)。该函数在头文件本身中定义,并且没有cpp文件与它们一起使用(我不确定这是否是导致问题的
)。但有趣的是,我收到一个错误,无法找到头文件!有没有人遇到过这样的问题? 


谢谢

解决方案

只是因为你可以看到标题解决方案资源管理器节点中的文件并不意味着编译器会在构建期间找到它们。 那么头文件实际位于何处? 它们是否与包含#include指令的源文件
位于同一文件系统位置? 请参阅
https:// docs .microsoft.com / EN-US / CPP /预处理器/散列包括-指令-C-CPP?视图= VS-2019


Hi,

I added header files to a console application project. I can see the header files in the solution explorer (in the header file section). The function are defined in the header file itself and there are no cpp file to go with them (I'm not sure if that is causing an issue). But interestingly I'm getting an error of not being able to locate the header files! Has anyone experience such an issue before? 

Thanks

解决方案

Just because you can see the header file in the solution explorer node doesn't mean that the compiler will find them during a build.  So where are the header files actually located?  Are they in the same file system location as the source file that contains the #include directive?  See https://docs.microsoft.com/en-us/cpp/preprocessor/hash-include-directive-c-cpp?view=vs-2019


这篇关于标题已添加但未被识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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