我正在使用Microsoft Visual C ++ 2010作为一个简单的控制台应用程序,但我遇到了包含我想作为配置文件制作的头文件的问题
目录看起来像这样
-AI
--config
--config.h
--Header Files
--Resource Files
--Source Files
AI.cpp
// AI.cpp : main project file.
#include "stdafx.h"
#include <cstdio>
//include config file
#include "../config/config.h"
using namespace System;
using namespace std;
config c;
int main()
{
count << "My name is: " << c.getName;
std::getchar();
}
config.h文件
Class config
{
public void getName(){
return 'Awesome'
}
}
当我点击Build按钮时,我收到以下错误:
1>AI.cpp(7): fatal error C1083: Cannot open include file: 'config\config.h': No such file or directory
答案 0 :(得分:2)
来自 VoidStar 的解决方案:
Right click on the include and click on Open Document "config.h".
If VS can't resolve the path you'll get an error that tells you where it looked.