简体   繁体   中英

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)

#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:

#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.

I have checked, and both my cpp file and my header are located at the following directory:

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. Thanks!

Your include is wrong, you must use ", but not ”. You have:

#include "Item.h”

You should have:

#include "Item.h"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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