Web lists-archives.com

Re: [Mingw-msys] Re: Description of MSYS in forthcoming C++ Cookbook, by O'Reilly




Hi Rajneesh,

Please post plain text only, and do not top post; if you ignore this 
request, in further posts, I will not reply.

On Tuesday 25 November 2008 07:14:52 rajneeshraju.vetukuri@xxxxxxxxx 
> 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"
>
> [...snip...]
>
> Please help me through this.

Sorry, but unless you give us a minimal self-contained test case, to 
demonstrate your problem, we cannot help you.  Based on what you've 
given us so far, here is mine, which works perfectly, exactly as I 
would expect:--

  $ mkdir -p foo/include/foobar/foo

  $ cd foo

  $ echo '#define FOO_SUCCESS  0' > include/foobar/foo/foo.h

  $ echo '#include "foo/foo.h"
      int main() { return FOO_SUCCESS; }' > foo.c

  $ echo 'foo.exe: foo.c ${LOCAL_INCLUDES}/foo/foo.h
  <TAB>   gcc -I${LOCAL_INCLUDES} -o $@ foo.c' > Makefile

  $ export LOCAL_INCLUDES=`pwd`/include/foobar

  $ make foo.exe
  gcc -I/home/keith/foo/include/foobar -o foo.exe foo.c

and FTR,

  $ gcc -I$LOCAL_INCLUDES -o foo.exe foo.c

works silently, and just as well as `make foo.exe'.

Regards,
Keith.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mingw-msys mailing list
Mingw-msys@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mingw-msys