Dear Users,
I downloaded QuantLib Swig Bindings from
and successfully compiled NQuantLib_vc10 and the two examples (EquityOption and BermudanSwaption)
I then ran EquityOption.exe that thrown an exception at the moment of instatntiating the QuantLib Date :
Date todaysDate = new Date(15, Month.May, 1998);
The exception is the following:
System.TypeInitializationException was unhandled
HResult=-2146233036
Message=The type initializer for 'QuantLib.NQuantLibcPINVOKE' threw an exception.
Source=NQuantLib
TypeName=QuantLib.NQuantLibcPINVOKE
StackTrace:
at QuantLib.NQuantLibcPINVOKE.new_Date__SWIG_1(Int32 jarg1, Int32 jarg2, Int32 jarg3)
at QuantLib.Date..ctor(Int32 d, Month m, Int32 y) in V:\Risk\QuantLib-SWIG-1.1\CSharp\csharp\Date.cs:line 48
at BermudanSwaption.Run.Main(String[] args) in V:\Risk\QuantLib-SWIG-1.1\CSharp\examples\BermudanSwaption.cs:line 72
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TypeInitializationException
HResult=-2146233036
Message=The type initializer for 'SWIGExceptionHelper' threw an exception.
Source=NQuantLib
TypeName=SWIGExceptionHelper
StackTrace:
at QuantLib.NQuantLibcPINVOKE.SWIGExceptionHelper..ctor()
at QuantLib.NQuantLibcPINVOKE..cctor() in V:\Risk\QuantLib-SWIG-1.1\CSharp\csharp\NQuantLibcPINVOKE.cs:line 126
InnerException: System.DllNotFoundException
HResult=-2146233052
Message=Unable to load DLL 'NQuantLibc': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=NQuantLib
TypeName=""
StackTrace:
at QuantLib.NQuantLibcPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_NQuantLibc(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
at QuantLib.NQuantLibcPINVOKE.SWIGExceptionHelper..cctor() in V:\Risk\QuantLib-SWIG-1.1\CSharp\csharp\NQuantLibcPINVOKE.cs:line 106
InnerException:
Does anyone have any idea ?
Many Thanks in advance