|
From: Ferdinando A. <fer...@am...> - 2002-06-05 11:34:00
|
Hi Andre Luigi is the master of SWIG, but here's a few suggestions while we wait for his answer >I have a cpp class in a library of my own that inherits off >QuantLib::Instrument. I now need to create a SWIG file for this. >I assumed that I would only need to "%import Instruments.i" to get the >needed definitions, this leads to all kinds of compile errors. >Using "%include Instruments.i" doesn't hack it either, I would "%include ql.i", this will include all the QuantLib interfaces and this is probably what you want, since you will want your module to include the whole QuantLib module to use all the QuantLib feautures. >but I get weird errors when using my library: accessing >DayCounter.yearFraction(d1,d2) for instance gives me an error saying it >needs 5 arguments (only 3 supplied) - it's as if it doesn't know the last 2 >are default arguments. see the file QuantLib-Python\QuantLib\defaults.py for the specification of default values. Your module will need that file. Hope this helps ciao -- Nando PS Luigi, when we'll settle on the new forthcoming version of SWIG with all languages consolidated into a single QuantLib-SWIG module, do you plan to provide an example on how to setup a project based on QuantLib-SWIG? It would be similar in spirit to our C++ Examples based on QuantLib. |