This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Add search path to the cygwin.


"Fu, Jack" wrote:
> 
> Hi all:
> 
> Can anyone tell me how to add search path to the cygwin bash shell?  I tried
> to use gcc to compile a simple program and it is looking for some header
> files.  I tried to add path using $ $PATH=/cygnus/include:$PATH.  What is
> the correct command?
> 
> Thanks
> Jack

Paths for include file directories usually aren't specified with $PATH,
but instead specified in the make input file, default name being
"Makefile"; or, as a command line argument to the make command, when you
invoke it.  

Read the man page on make, is the first place to start.

If, however, defining the path in $PATH is supposed to work for what
you're doing, then make sure to export PATH after modifying it's
definition.

      $PATH=/cygnus/include:$PATH
      export PATH

      or

      $PATH=$PATH:/cygnus/include
      export PATH

I had the latter problem last night when trying to build SmallEiffel; it
said to add SmallEiffel/sys/system.se to PATH, but forgot to mention to
say to also export PATH.  Doing that got rid of the remaining problem.

How you'd redefine PATH, e.g., inserting /cygnus/include as the first or
as the last directory, depends on your environment.  If there are files
in this directory which exist in other of your PATH directories and you
want to use the first one found, then put /cygnus/include at the end. 
If you want to use the /cygnus/include files, regardless of whether
there are files by the same name in other PATH directories, then put
/cygnus/include at the beginning of PATH.

However, if you're always going to use this directory when you're doing
what you're doing, then defining this in your make input file, or as a
command line argument to make, may be better, or just as good.  I think
it can be specified on the command line, but this may override what's
already defined in the make file, if there are includes defined there. 
(This is what happens with env variables in the Makefile and this may
also preclude the build from working.)  

I've always defined these and seen these defined in the make file.  I've
never seen PATH used to specify the location of include directories, but
PATH might work in your case (seems strange to me, though, i.e., for
include directories).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]