Tom Fong
Tom Fong

Reputation: 77

cannot open the header file in C++

I'm doing my assignment that need to using the #include function but I found that after I define the header file, I cannot open the header file in the main.cpp and I also didn't find any xxx.h file in the project file

here is the situation

enter image description here

enter image description here

enter image description here

The reason of search.h can open is I found that in external dependencies file, there is a search.h, but the search.h I want to open is not the search.h in external dependencies file

Upvotes: 1

Views: 3342

Answers (2)

schillingjerrid
schillingjerrid

Reputation: 57

It looks like you don't have any header files included in your project. Visual Studio is attempting to find the header files in the header directory of your project but it cannot find any. Save your header files into separate files and add them to your header directory in the project. Then you should not have any problem.

Upvotes: 1

Hassnain Jamil
Hassnain Jamil

Reputation: 1681

You don't have header files in your project. Create the header files xxx.h in the project directory. So the compiler will be able to locate them.

If the person who gave you the project has provided you the header files along with the project requirements then, just copy and paste the xxx.h files into the project directory. This would solve your problem.

To learn more about the header file. Click on the below tutorial link

Header Files

How to add header files in Visual Studio 2010 - Youtube

Upvotes: 2

Related Questions