By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,125 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,125 IT Pros & Developers. It's quick & easy.

How to include header files..

P: 5
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
Share this Question
Share on Google+
3 Replies


P: 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

P: 5
Thanks pencil, it was easier than I thought.
Jul 6 '06 #3

P: 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.