From: William S F. <ws...@fu...> - 2005-11-21 22:20:43
|
Bob Marinier wrote: > I'm using SWIG 1.3.27, although I think this problem has existed for a > while. > > I'm trying to wrap this .i file for Java (1.4.2) on Windows with > "swig.exe -Wall -c++ -package test -java test.i" > > %module test > %javaconst(1); > > namespace test { > typedef enum > { > test1_first = 1, > test1_second, > test1_last = test1_second > } test1; > > typedef enum > { > test2_first = test1_last+1, > test2_second, > test2_last = test2_second > } test2; > }; > > SWIG runs without any errors or warnings, and the generated C++ wrapper > file compiles without any errors or warnings (VS.NET 2003), but the > generated Java code gives this error when I try to compile it: > > test2.java:11: ')' expected > public final static test2 test2_first = new test2("test2_first", > test::test1_last+1); > ^ > > Is this a SWIG bug or a limitiation? Or am I making a mistake somewhere? > Limitation when using %javaconst(1). You can use the %javaconstvalue to workaround. See the docs. William |