Visual Studio 不支持包含目录 [英] Visual Studio does not honor include directories

查看:21
本文介绍了Visual Studio 不支持包含目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到过很多次这种情况,当涉及到 lib头源文件时,visual studio 不支持附加包含目录.例如,我刚刚下载了 MyGUI 源代码并确保包含目录正确.我什至把它们放在绝对路径中,Visual Studio 仍然抱怨找不到特定的头文件.

I have been in this situation quite a few times where visual studio does not honor the Additional Include Directories when it comes to lib and header source files. For example, I just downloaded MyGUI source code and made sure the include directories were correct. I even put them to absolute paths, Visual Studio still complained that it could not find specific header files.

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

Does anybody experience the same thing with projects, and if so, is there a solution to this problem?Blockquote

我很抱歉无法完全解释.我知道库和源文件有不同的包含目录.我收到的项目具有附加包含目录和附加库目录的正确目录路径,但 Visual Studio 仍然无法正确识别它们.我可以右键单击并在 Visual Studio 中打开头文件,但是在编译时它仍然抱怨找不到所需的头文件.我经常依赖自己编写的框架来制作项目,所以我非常熟悉如何设置依赖项.然而,这似乎是第二次发生.我不记得上次我试图编译哪个 3rd 方项目,但 Visual Studio 只是拒绝相信 Additional Include Directories 路径是它应该查找头文件的地方.我不确定如何提供此特定库 (MyGUI) 的完整详细信息,但我可以将您指向可以下载它的网站,以尝试查看它是否能够找到项目中包含的头文件(如果它不编译,那很好,可能是因为额外的依赖,但它至少应该能够在公共文件夹中找到文件,尤其是当我将绝对路径放在附加包含目录中时)

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)

推荐答案

我已经找到(偶然发现)解决方案(我认为).它与操作系统强加的字符限制有关.虽然限制应该是 260,但对我来说它低于 150,查看此讨论及其链接.我下载并解压文件到 C:UsersMyUserNameMy DocumentsDownloadsDownloads From ChromeMyGui3.0...[等等].前段时间我学会了不要尝试在这么长的路径下编译项目,但这一次我完全忘记了,因为 VS 根本没有给我警告并指出我错误的方向.无论如何,将项目剪切并粘贴到 D: 解决了这个问题.在有人确认之前,我不会勾选答案.

I have found (stumbled) on the solution (I think). It has something to do with the character limit imposed by the OS. Although the limit should be 260, for me it falls in the below 150, see this discussion and links to it. I downloaded and unzipped the file to C:UsersMyUserNameMy DocumentsDownloadsDownloads From ChromeMyGui3.0...[and so on]. I learned quite some time ago not to try to compile projects under such long paths, but this time it completely slipped my mind as VS did not give me a warning at all and pointed me in the wrong direction. Anyway, cutting and pasting the project to D: fixed the issue. I am not going to checkmark the answer however until someone confirms this.

这篇关于Visual Studio 不支持包含目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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