Re: calendar problem when calling quantlib lib from java
Posted by moloko on
URL: http://quantlib.414.s1.nabble.com/calendar-problem-when-calling-quantlib-lib-from-java-tp5595p5609.html
Hi,
So, I've been able to run my simple test file which does not use JNI ( only QuantLib ), thanks to Luigi.
So now, I gonna try to be more precise about my main issue:
I've got a cpp file which is calling QL functions and JNI to produce functions in a library called in a java process.
I need to update our QuantLib version from 0.3.4 to 0.8.1.
The problem is that my java process crash at runtime.
I've tried to isolate the line responsible for that crash
I've got 2 types
Calendar calendar = UnitedStates();
and
DayCounter dayCounter = Thirty360(Thirty360::European);
but
Calendar calendar = TARGET() do not lead to crash
and neither
DayCounter dayCounter = Actual360();
I've copy-pasted the cpp file
-------------------------------------
#include <ql/quantlib.hpp>
#include <jni.h>
#include "QuantLibCalculation.h"
using namespace QuantLib;
JNIEXPORT jboolean JNICALL toto
(){
Calendar calendar = UnitedStates();
//DayCounter dayCounter = Thirty360(Thirty360::European);
return JNI_TRUE;
}
-------------------------------------
here is the command line I use to compile :
g++ -o libFTXQuantLib.o -shared -I/usr/java/jdk_1.5.0_11/include -I/usr/java/jdk_1.5.0_11/include/linux -lQuantLib QuantLibCalculationNEW.cpp -fPIC
If someone can help...
Pierre