classes gives errors

hi guys i m new at linux programing actually new at programing and i have a problem.

at windows #include "myclass.h" wasnt giving any errors but in linux(i use ubuntu) i m having this error
1
2
fatal error: birthday.h: No such file or directory|
||=== Build finished: 1 errors, 0 warnings ===|


after i changed it to this "include/myclass.h" i dont get any error.

and here is the problem what should i do if i need to reach a class from another class.
"birthday.cpp" is in kk/src folder and "birthday.h" is in kk/include folder and "main.cpp" is in kk folder. it is not giving errors if i try to reach birthday.h from main.cpp. But from any class(all classes's cpps r in kk/src folder) it gives this error
1
2
fatal error: include/birthday.h: No such file or directory|
||=== Build finished: 1 errors, 0 warnings ===|

it was very long. hope u guys can help me i know it is very simple but cant find the solution

and if it is needed Linux CesetPC 3.10.3-031003-generic #201307251835

Thank you all in advance
Last edited on
closed account (Dy7SLyTq)
you need to do some more research on paths. for the non-main.cpp files, make it either an absolute path or "../include/whateverfile.h"
ty DTSCode i just used ../ and it went perfect. ty again
closed account (Dy7SLyTq)
np. but i would seriously do some more research on file paths, because not to be mean (but i am speaking the truth), you have a fundamental gap. that should be easy. i would start with this: http://en.wikipedia.org/wiki/Path_(computing)
it looks promising
might be because instead of learning com. i started from programming. whatever thx again
man gcc wrote:
-Idir
Add the directory dir to the head of the list of directories to be
searched for header files.

that way you don't have to worry about where is your source file located.
closed account (Dy7SLyTq)
i know that was meant for ceset, but thanks ne555. that will make my compilation cleaner. i didnt know about that
Topic archived. No new replies allowed.