sig*_*gil 8 c++ visual-studio visual-c++ visual-studio-2012
与此问题相关,我在控制台应用程序的代码中包含了一个头文件,我用它来测试DLL,但Visual Studio返回以下错误:
error C1083: Cannot open include file: 'myProject.h': No such file or directory
Run Code Online (Sandbox Code Playgroud)
但我已myProject.h在"其他包含目录"中包含了文件夹路径.我也尝试在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);
}
Run Code Online (Sandbox Code Playgroud)
当我输入"#包括"智能感知显示我只有3项:对应的Debug文件夹U:\Software Development\c++ projects\myProject\myProject\Debug,stdafx.h和targetver.h.
可能解决方案1:
#include "../myProject.h"
Run Code Online (Sandbox Code Playgroud)
可能解决方案2:
Project Properties~> C/C++〜> General~> Additional Include Directories,尝试设置相对于你的.sln(解决方案)文件所在目录的路径.如果解决方案在,U:\Software Development\c++ projects\myProject\则尝试将其设置为$(SolutionDir)myProject
| 归档时间: |
|
| 查看次数: |
31816 次 |
| 最近记录: |