cons-discuss
[Top][All Lists]
Advanced

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

QuickScan and exported files....


From: Eric Brown
Subject: QuickScan and exported files....
Date: Tue, 29 May 2001 13:18:16 -0700

I'm running into a problem using Cons to build IDL files that include files
outside the current directory.  In particular, the header file isn't getting
copied to the export directory before the IDL compiler is getting called.

The details are as follows:

I have a top level Inc directory that contains a file Ecm_err.h.

In another directory, I have a file ECMWrapperS3.idl that has the following:
// This file will be processed by the MIDL tool to
// produce the type library (ECMWrapperS3.tlb) and marshalling code.
#include <Ecm_err.h>

import "oaidl.idl";
import "ocidl.idl";

<lots of IDL follows>

My IDL generator function contains the following call to QuickScan:

    $env->QuickScan(
                sub { my(@includes); 
                        do {
                                push (@includes, $3 ) 
                                        if
/^\s*(#include|import)\s+(\")(.+)(\")/ && $3 
                        } 
                        while <SCAN> ;
                        @includes 
                } ,
                "$args{IDL}",
                "$env->{CPPPATH}" 
    );

$env->{CPPPATH} is
"build\debug\ECMWra~1\ECMWrapperS3\res;#export/debug/include;#export/debug/i
nclude".

Inc/Conscript has

# Put Headers Here
@HDRS = qw(
        Ecm_err.h
        Ecm_all.h
        Ecm.h
        Add.h
        Add_err.h
        );

Install $CONS $INCLUDE, @HDRS;

If I print @includes in the QuickScan call, I get "Ecm_err.h oaidl.idl
ocidl.idl"
So, as you can see, everything *looks* like it ought to be copying
Inc/Ecm_err.h to #export/debug/include, where the IDL compiler can find it.
Instead, all I get is this:
D:\tropics\Ver1.0>cons
midl.exe /Ibuild\debug\ECMWra~1\ECMWrapperS3\res /Iexport/debug/include
/Iexport/debug/include /char unsigned /h "ECMWrapperS3.h" /iid
"ECMWrapperS3_i.c" /tlb "ECMWrapperS3.tlb" /out
build\debug\ECMWra~1\ECMWrapperS3 /Oicf
build\debug\ECMWra~1\ECMWrapperS3\ECMWrapperS3.idl
Microsoft (R) MIDL Compiler Version 5.01.0164
Copyright (c) Microsoft Corp 1991-1997. All rights reserved.
Processing build\debug\ECMWra~1\ECMWrapperS3\ECMWrapperS3.idl
ECMWrapperS3.idl
build\debug\ECMWra~1\ECMWrapperS3\ECMWrapperS3.idl(8) : fatal error C1083:
Cannot open include file: 'Ecm_err.h': No such file or directory
midl : command line error MIDL1003 : error returned by the C preprocessor
(2)
cons.bat build_error: *** [build\debug\ECMWra~1\ECMWrapperS3\ECMWrapperS3.h]
Error 60160
cons.bat build_error: errors constructing
build\debug\ECMWra~1\ECMWrapperS3\ECMWrapperS3.tlb

I can hack it into working (by manually including the inc directory), but I
don't think I should have to do this.

Any suggestions?  (I'm running Tony Kolarik's modified version of Cons 1.8.)



reply via email to

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