SWIG 0.3.13 Java - resulting files do not compile

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SWIG 0.3.13 Java - resulting files do not compile

jmfj
I am having trouble compiling Java sources generated during
QuantLib-SWIG-0.3.13.zip default installation procedures.

Installation goes well all the way to the end, however the resulting
Java files have a number of calls to int.swigValue() similar to the
example below:

public void setValue(double arg0, int arg1) {
     quantlibJNI.IntervalPrice_setValue(swigCPtr, arg0, arg1.swigValue());
}

Of course, it is not a valid Java construct.


In timeseries.i, you see

(...)
void setValues(Real, Real, Real, Real);
(...)

what generates a consistent code, and

(...)
void setValue(Real, IntervalPrice::Type);
(...)

what is giving trouble...

Changing all Interval::Type types to Real fixes the problem, but I am
pretty sure that may make the library unusable...

Any suggestions?

Thanks,
--jmfj.









Reply | Threaded
Open this post in threaded view
|

Re: SWIG 0.3.13 Java - resulting files do not compile

Luigi Ballabio
On Wed, 2006-08-30 at 11:32 -0400, jmfj wrote:
> I am having trouble compiling Java sources generated during
> QuantLib-SWIG-0.3.13.zip default installation procedures.

jmfj,
        thanks for the report (and apologies forthe delay---vacations got into
the way.)  The error is fixed in CVS now. If you want to patch your
installation, you'll have to modify timeseries.i so that the enum
declared in the IntervalPrice class is in the public section. After you
regenerate the wrappers (you'll have to use SWIG 1.3.29) the code should
be correct.

Later,
        Luigi


----------------------------------------

feature, n:
A surprising property of a program. Occasionally documented.
To call a property a feature sometimes means the author did not
consider that case, and the program makes an unexpected, though
not necessarily wrong response. See BUG. "That's not a bug,
it's a feature!" A bug can be changed to a feature by
documenting it.