468,468 Members | 2,686 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,468 developers. It's quick & easy.

How to include header files..

Hi,

Could somebody tell me how to include my classes in a file which does not see them? (Figure below).


[Level 0] .............................................My Project......................................
.................................................. ...............|.................................. .............
......................................--------------------------------------------------.............
......................................|........... .................................................| .............
[Level 1] ................Classes ............................................... Functions...
......................................|........... .................................................| .............
.......................... --------------------------........................................|......... ....
...........................|...................... ........|........................................| .............
[Level 2] ...Class_A.h...............Class_B.h...................myFunction.h




I know 2 typical methods: Relative path and Absolute path.

But "myFuction.h" in “Function” directory does not accept the relative address: ”My project\Classes\Class_A.h”.

On the other hand, I don’t want to use an absolute path for the sake of portability.

Is there any one who knows what the trick is??!!

Thanks all,
Jul 4 '06 #1
3 7716
pencil
2
Hi,

Could somebody tell me how to include my classes in a file which does not see them? (Figure below).


[Level 0] .............................................My Project......................................
.................................................. ...............|.................................. .............
......................................--------------------------------------------------.............
......................................|........... .................................................| .............
[Level 1] ................Classes ............................................... Functions...
......................................|........... .................................................| .............
.......................... --------------------------........................................|......... ....
...........................|...................... ........|........................................| .............
[Level 2] ...Class_A.h...............Class_B.h...................myFunction.h




I know 2 typical methods: Relative path and Absolute path.

But "myFuction.h" in “Function” directory does not accept the relative address: ”My project\Classes\Class_A.h”.

On the other hand, I don’t want to use an absolute path for the sake of portability.

Is there any one who knows what the trick is??!!

Thanks all,
It's strange that nobody replied to such a simple question.
Anyway I think that it is "..\Classes\Class_A.h"

The ..\ access to the parent directory.
For eg. your project folder relative path from "Function" directory would be
"..\" or also "..\..\My Project"

Is it ok?
Jul 6 '06 #2
Thanks pencil, it was easier than I thought.
Jul 6 '06 #3
pencil
2
Yes, it's easy.
Usually you learn it by experience, but if you've never faced something similar it is difficult to figure it out ( there are no tutorials or something.. )

May the Force be with you (and your code). ;)
Jul 7 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

28 posts views Thread by Ramesh | last post: by
60 posts views Thread by Derrick Coetzee | last post: by
44 posts views Thread by Neil Cerutti | last post: by
12 posts views Thread by Francois Grieu | last post: by
14 posts views Thread by Pedro Graca | last post: by
14 posts views Thread by Jon Rea | last post: by
9 posts views Thread by chat | last post: by
111 posts views Thread by Nate | last post: by
8 posts views Thread by The Cool Giraffe | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.