[英]fatal error C1083: Cannot open include file: 'Item.h”': No such file or directory
I have a .cpp file called factory.cpp, that looks as follows: (just starting the program) 我有一个名为factory.cpp的.cpp文件,其外观如下:(只需启动程序)
#include "stdafx.h"
#include "Item.h”
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <ctime>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
My item.h looks like this: 我的item.h看起来像这样:
#ifndef ITEM_H
#define ITEM_H
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <ctime>
Class Item{
public:
...
private:
...
};
#endif
When I try to compile I get the following error: fatal error C1083: Cannot open include file: 'Item.h”': No such file or directory. 当我尝试编译时,出现以下错误:致命错误C1083:无法打开包含文件:'Item.h”':没有此类文件或目录。
I have checked, and both my cpp file and my header are located at the following directory: 我已经检查过了,我的cpp文件和标头都位于以下目录中:
c:\\Users\\User\\documents\\visual studio 2010\\Projects\\factory\\factory\\ c:\\ Users \\ User \\ documents \\ Visual Studio 2010 \\ Projects \\ factory \\ factory \\
and just to be on the safe side I even added this directory to additional included directories, yet stil no success... I am using Microsoft Visual Studio 2010 express, and would greatly appreciate your help. 为了安全起见,我甚至将此目录添加到了其他包含的目录中,但仍未成功...我正在使用Microsoft Visual Studio 2010 Express,非常感谢您的帮助。 Thanks! 谢谢!
Your include is wrong, you must use ", but not ”. You have: 您的include错误,您必须使用“,但不能使用”。您有:
#include "Item.h”
You should have: 你应该有:
#include "Item.h"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.