gpt4 book ai didi

visual-studio - Visual Studio 不支持包含目录

转载 作者:行者123 更新时间:2023-12-03 10:49:57 27 4
gpt4 key购买 nike

我曾多次遇到这种情况,Visual Studio 不尊重 其他包含目录 谈到libheader source files .例如,我刚刚下载了 MyGUI 源代码并确保包含目录正确。我什至把它们放到绝对路径下,Visual Studio 仍然提示找不到特定的头文件。

有没有人在项目中遇到过同样的事情,如果有,有没有解决这个问题的方法?Blockquote

EDIT: My apologies for not being able to explain fully. I know that the library and source files have different include directories. The project that I received had correct directory paths for the Additional Include Directories and Additional Library Directories but Visual Studio still failed to recognize them properly. I can right click and open the header file within Visual Studio but when compiling it still complains it cannot find the required header files. I regularly make projects relying on a framework I myself programmed, so I am quite familiar with how to set up dependencies. This is however the second time this seems to be happening. I don't recall which 3rd party project I was trying to compile last time, but Visual Studio simply refused to believe that the Additional Include Directories paths is where it should look for the header files. I am not sure how to give the complete details of this particular library (MyGUI) but I can point you to the website where you can download it to try and see if it is able to find the header files that are included in the project (if it doesn't compile, that is fine, and it is probably because of additional dependencies, but it should at least be able to find files in the common folder, especially when I put absolute paths in Additional Include Directories)

最佳答案

我刚刚花了几个小时与编译器中失败的#include 路径、编译器和智能感知之间的不一致作斗争。
我最终发现,在 *.cpp 文件的属性中——不是项目,而是单个 *.cpp 文件——“附加包含目录”属性是空白的。我必须将其显式设置为“从父级或项目默认值继承”——对话框左下角附近有一个用于编辑目录路径的复选框。
我从另一个项目中复制了这个文件,并使用“添加 > 现有项目...”将它添加到当前项目中。我的假设是“现有项目”过程可能跳过了“新项目”通常会执行的属性初始化步骤。但我只是通过添加另一个现有的和一个新的来测试这个假设。这两个文件的属性都设置为从项目继承,所以我没有解释为什么我的问题文件最初没有设置为继承。
无论如何......经过很多挫折,找到并修复了那个。

关于visual-studio - Visual Studio 不支持包含目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3790632/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com