[cable] rather sporadic error messages

Brad King brad.king at kitware.com
Fri Mar 28 09:53:53 EST 2003


>     switch (result)
>       {
>       case ::DVPSD_CIELAB: name = "::DVPSD_CIELAB"; break;
>       case ::DVPSD_GSDF: name = "::DVPSD_GSDF"; break;
>       case ::DVPSD_first: name = "::DVPSD_first"; break;
>              (1)
>       case ::DVPSD_max: name = "::DVPSD_max"; break;
>       case ::DVPSD_none: name = "::DVPSD_none"; break;
>             (2)
>       }
[snip]
> statement. However, Visual C gives the following error:
> "error C2196: case value '0' already used", which directs at the (1)
> line, and
> "error C2196: case value '2' already used", which directs at the (2) line.

My guess is that the DVPSDisplayTransform has two names for the same
enumeration value.  Perhaps something like this:

enum X { A=0, B=1, C=0 };

I did not anticipate this design when implementing the enum-return
generation in CABLE.  Unfortunately, there is no way for the code to know
which named enumeration constant was used to assign the value.  The fix
will have to be for CABLE to just pick one of the named constants that
have that value.

Let me know if this seems to be the case for the library you're wrapping.
If so, I'll try to fix it in CABLE.  Otherwise, there may be another bug.

> the whole generated file is 1555 kB in size!

I suggest trying to split up the wrappers into more groups.  This will
reduce the length of the generated files (but there will be more of them).
Unless you split it up, eventually you'll hit MSVC 6's stack-limit and no
longer be able to compile the generated sources.

-Brad




More information about the cable mailing list