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

4
  • 1
    clearly you need those files so your program can work, maybe ask the professor who gives you the assignment would help Commented Feb 28, 2016 at 6:18
  • Did you create the project from scratch or did somebody gave you that project folder and you opened it in VS? Commented Feb 28, 2016 at 6: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 Commented Feb 28, 2016 at 6: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. Commented Feb 28, 2016 at 6:26

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.