Hi everybody, I have a problem in include path. i want to keep my all header file in folder named myInclude and include it like #include<myInclude/header.h>, Is there any possible way to do this, if there is than please tell me the step.
thanks in advance...........

Recommended Answers

Use unix profile file

Jump to Post

All 4 Replies

Hey there,

If you're doing this for C, you can just use quotes instead of the angle brackets, like

#include "/home/yourdir/myInclude/header.sh"

If you're using a shell and your includes are functions, you can put them in your .profile, as advised above or just create your header.sh file and source it at the head of all of your script like:


. /home/yourdir/myIncludes/header.sh


and you'll be all set :)

, Mike

> #include "/home/yourdir/myInclude/header.sh"
Don't do this.
Absolute paths to header files are a disaster waiting to happen.
If you reorganise your workspace, or give the code to someone else, then you have to edit ALL the code just to make it compile again.

Instead, do gcc -I/home/yourdir prog.c where /home/yourdir is the place where the myInclude directory exists, containing the header.h file.

Thank u salem. its working...........

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.