我使用Microsoft Visual C++ 2010作为一个简单的控制台应用程序,但是我在包含一个作为配置文件的头文件时遇到了问题。
目录看起来像这个
-AI
--config
--config.h
--Header Files
--Resource Files
--Source FilesAI.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发布于 2012-08-27 12:19:00
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.https://stackoverflow.com/questions/12141718
复制相似问题