Hi Keith,

 

To the first part of this query, I would like to bring out that I set up some of the Include directories by setting the environment variables such as INCLUDE_DIR and then passing it to my compiler through –I option.

 

In some instances I have a directory structure where in I have sub directories as well. For example in have a following directory structure such as

 

include/dir1/dir2 and the header file.

 

In this case I specify the root directory as include/dir1 while in my C code I will have the #include “dir2/header.h”

 

While the compiler is compiling it is searching for a path like include/dir1\dir2/header.h in this case the path conversion is controlling the linkage between path we passed as environment variable and that included in the code.

 

Another place I have checked is where in like I have just preprocessed the files and I got lot on above instances where in the path specified is a mixture of Unix and Windows path and ultimately not finding the path. That file is not include in the preprocessed file and just indicates the path which has been included.

 

Also, if I give the complete path in Windows format, then it is including the path and is able to compile successfully. But I don’t want to modify the code, least it will loose its platform independency.

 

I hope, This is not the expected behavior of msys.

 

Please help me through this.

 

With Regards,

 

Rajneesh

 

 

Re: [Mingw-msys] msys Path Conversion Problems

From: Keith Marshall <keithmarshall@us...> - 2008-11-21 20:35

On Friday 21 November 2008 12:06:49 rajneeshraju.vetukuri@wi...
wrote:
> I am facing a problem where in my .c source
> files are not able to find the header files which are located in
> the other directories.

There has been an almost identical query, within the last week, on the
MinGW-Users list, (which is probably where this would have been best
asked too).

> In some location in .c source files we have definitions such as
> #include "dir/header.h"

Are you saying that your compiler cannot find these header files, when
you try to compile the code? If so, then this has nothing to do with
MSYS path translation; `dir/header.h' must be a relative path, which
is relative to the directory in which the source file containing the
`#include "dir/header.h" directive is to be found.

Otherwise...

> Due to this when msys tries to find the file

...you will have to explain, preferably by means of a minimal self
contained example, exactly what you mean by this. You need to show
us what is happening, to lead you to the conclusion that `MSYS cannot
find the header files'. How have you actually instructed MSYS,
rather than your compiler, to look for them?

Regards,
Keith.