Hi All.
I just created a myproject folder. This folder contains two sub folders i.e. src and include to hold .cpp and .h files.
I created a simple class in student.h file and defined a simple display function in student.cpp file.
Then I created another file inside src folder where I defined my main function i.e. mainfile.cpp and called display function.
The exact directory structure is this....
myproject
- include
-student.h
-src
-student.cpp
-mainfile.cpp
I compiled .h file. It compiled successfully. I compiled this from within include folder.
Then I tried to compile .cpp file using
c:\myproject\src\ g++ student.cpp
But it gave error as it could not find student.h file. I had included student.h file within the student.cpp file.
Can any one help about how can I compile .cpp file successfully.