954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Header FileS in Other Directories

I'm using a set of classes with lots of *.h files. These files are located in a separate directory & I do not want to copy them to my own folder. I can add the path of the *.h file I use in the #include. However if that *.h file refers to another *.h file then I must change lots of #include.

BTW, I prefer not to use a makefile & do something only within *.c & *.h files :cheesy:

rkarimi
Newbie Poster
8 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

The best answer is to use a makefile/IDE. If you don't want to, yes, it is a lot of editing. That is precisely why you generally don't specify a path on the #include line and instead point the compiler at where to look.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 
The best answer is to use a makefile/IDE. If you don't want to, yes, it is a lot of editing. That is precisely why you generally don't specify a path on the #include line and instead point the compiler at where to look.


OK, then How can I use makefile on MAC?

rkarimi
Newbie Poster
8 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

Does your compiler have any documentation? If you let us know what compiler you have we can all Google for this information.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You