繁体   English   中英

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

[英]fatal error C1083: Cannot open include file: 'Item.h”': No such file or directory

我有一个名为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;
}

我的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

当我尝试编译时,出现以下错误:致命错误C1083:无法打开包含文件:'Item.h”':没有此类文件或目录。

我已经检查过了,我的cpp文件和标头都位于以下目录中:

c:\\ Users \\ User \\ documents \\ Visual Studio 2010 \\ Projects \\ factory \\ factory \\

为了安全起见,我甚至将此目录添加到了其他包含的目录中,但仍未成功...我正在使用Microsoft Visual Studio 2010 Express,非常感谢您的帮助。 谢谢!

您的include错误,您必须使用“,但不能使用”。您有:

#include "Item.h”

你应该有:

#include "Item.h"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM