1

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

Tom Fong
  • 97
  • 2
  • 6
  • 1
    clearly you need those files so your program can work, maybe ask the professor who gives you the assignment would help – Pooya Feb 28 '16 at 06:18
  • Did you create the project from scratch or did somebody gave you that project folder and you opened it in VS? – Nidhin David Feb 28 '16 at 06:21
  • The professor only give us a cpp file of the whole program and need us to separate it, so I already cut the file into 6 pieces – Tom Fong Feb 28 '16 at 06:24
  • 2
    That means you're expected to split out the header file yourself and add it to the project. What exactly it is going to contain, is up to you to solve, as a part of the assignment. – iksemyonov Feb 28 '16 at 06:26

2 Answers2

2

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

Community
  • 1
  • 1
Hassnain Jamil
  • 1,651
  • 17
  • 21
1

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.

Nidhin David
  • 2,426
  • 3
  • 31
  • 45