cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dependancy checking failure


From: Steven Knight
Subject: Re: Dependancy checking failure
Date: Thu, 4 Oct 2001 04:43:40 -0500 (CDT)

> We have been using Cons happily for months, but I ran into a nasty problem
> today.  Cons can not handle the case were a directory in CPPPATH has the
> same basename (last component of the path) as a #included file.
>
> For example, in our app we have /path-to-3rd-party-package/include/string in
> CPPPATH, and some other code #includes the standard C++ header <string>.
> Cons stops with following error message:
>
> cons.pl: you have attempted to use path 
> "/path-to-3rd-party-package/include/string" both as a file and as a directory!
>
> Are there any known fixes or work-arounds?  I couldn't find anything
> through google.

Which version of Cons?

I couldn't reproduce the problem by trying to create a simple test case:

        $ pwd
        /tmp/xxx/subdir
        $ cat Construct
        $env = new cons (
                # absolute path to outside include directory named 'string'
                CPPPATH => '/tmp/xxx/string'
        );
        Program $env 'foo', 'foo.cc';
        $ cat foo.cc
        #include <stdio.h>
        #include <stdlib.h>
        #include <string>       /* same name as the include directory */
        int
        main(int argc, char *argv[])
        {
                printf(STRING);
                exit (0);
        }
        $ ls -l /tmp/xxx/string
        total 4
        -rw-rw-r--    1 knight   knight         28 Oct  4 04:26 string
        $ cat /tmp/xxx/string/string
        #define STRING  "string 2\n"
        $ cons .        # not -I option and successful compilation
        cc -I/tmp/xxx/string -c foo.cc -o foo.o
        cc -o foo foo.o
        $ ./foo         # execute resulting binary
        string 2
        $

I tried a couple of obvious variations (multiple directories in CPPPATH,
"string" file in a different directory), but still no luck.  The above
worked at least back to Cons 2.0.1.

So it looks like we have some more subtle problem going on.  Could you
boil it down to a simple test case like the above, or provide more
information?

        --SK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]