简体   繁体   English

严重错误C1083:无法打开包含文件:“ Item.h”':没有此类文件或目录

[英]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.

相关问题 致命错误 C1083:无法打开包含文件:&#39;fstream.h&#39;:没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory 严重错误C1083:无法打开包含文件:&#39;mexutils.h&#39;:没有此类文件或目录 - fatal error C1083 : Cannot open include file: 'mexutils.h': No such file or directory 严重错误C1083:无法打开包含文件:&#39;vld.h&#39;:没有此类文件或目录 - fatal error C1083: Cannot open include file: 'vld.h': No such file or directory 致命错误 C1083:无法打开包含文件:“xyz.h”:没有这样的文件或目录? - fatal error C1083: Cannot open include file: 'xyz.h': No such file or directory? xxx.h:致命错误C1083:无法打开包含文件:&#39;yyyy.h&#39;:没有此类文件或目录 - xxx.h: fatal error C1083: Cannot open include file: 'yyyy.h': No such file or directory Visual Studio 2013:致命错误C1083:无法打开包含文件:&#39;winsock2.h&#39;:没有此类文件或目录 - Visual Studio 2013: fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory Microsoft Visual Studio Community 2019:致命错误 C1083:无法打开包含文件:'corecrt.h':没有这样的文件或目录 - Microsoft Visual Studio Community 2019: fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory SWIG致命错误C1083:无法打开包含文件 - SWIG Fatal error C1083: Cannot open include file QtCreator中的“致命错误C1083:无法打开包含文件” - “Fatal Error C1083: Cannot open include file” in QtCreator Qt-C ++-致命错误C1083:无法打开包含文件:&#39;afx.h&#39; - Qt - C++ - fatal error C1083: Cannot open include file: 'afx.h'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM