与此问题相关,我在用于测试 DLL 的控制台应用程序的代码中包含了一个头文件,但 Visual Studio 返回以下错误:
error C1083: Cannot open include file: 'myProject.h': No such file or directory
但是我已经myProject.h
在 Additional Include Directories 中包含了文件夹路径。我还尝试在 Configuration Properties->Debugging->Environment 下将其输入为“PATH=<...>”值。路径是: U:\Software Development\c++ projects\myProject\myProject
,当我去那个文件夹时,我可以myProject.h
在文件夹中看到。
#include "stdafx.h"
#include <iostream>
#include "myProject.h"
using namespace std;
int main()
{
cout << myProject::FileOperator::openDoc(1799,29);
}
当我键入“#include”时,Intellisense 只显示 3 个项目:对应于U:\Software Development\c++ projects\myProject\myProject\Debug
、stdafx.h
和的 Debug 文件夹targetver.h
。