Hi,
I am trying to follow the online tuturial to add a new function to QuantLibXL: http://quantlib.sourceforge.net/quantlibaddin/extend_tutorial.html I have created the following files: QuantLibAddin\qlo\stock.hpp (added to project QuantLibObjects) QuantLibAddin\qlo\stock.cpp (added to project QuantLibObjects) QuantLibAddin\gensrc\metadata\Functions\stock.xml (added to project qlgensrc) And edit the file QuantLibAddin\gensrc\config\categories.xml by adding this line: <categoryName>stock</categoryName> (without this step, rebuilding project qlgensrc is fine but no new files are generated) However when I rebuild project qlgensrc, the following error occurs: ------------------------------------------------------------------------------------------------------------------------------ Performing Makefile project actions Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. if not exist build\vc mkdir build\vc ..\..\gensrc\gensrc.py -a > > gensrc has encountered a fatal error. > > >>>>>>>>>> BEGIN STACK TRACE >>>>>>>>>> File "d:\build_ql_0_9_0\gensrc\gensrc.py", line 102, in addinList = addinlist.AddinList(addinIds) File "d:\build_ql_0_9_0\gensrc\gensrc\Addins\addinlist.py", line 127, in __init__ self.categoryList_ = categorylist.CategoryList() File "d:\build_ql_0_9_0\gensrc\gensrc\Categories\categorylist.py", line 72, in __init__ self.loadCategories(self.addinCategoryNames_, environment.config().addinFunctions()) File "d:\build_ql_0_9_0\gensrc\gensrc\Categories\categorylist.py", line 57, in loadCategories cat = utilities.serializeObject(category.Category, catDir + categoryName) File "d:\build_ql_0_9_0\gensrc\gensrc\Utilities\utilities.py", line 30, in serializeObject objectInstance.serialize(serializer) File "d:\build_ql_0_9_0\gensrc\gensrc\Categories\category.py", line 100, in serialize serializer.serializeObjectDict(self, function.Function) File "d:\build_ql_0_9_0\gensrc\gensrc\Serialization\xmlreader.py", line 161, in serializeObjectDict objectInstance.serialize(self) File "d:\build_ql_0_9_0\gensrc\gensrc\Functions\constructor.py", line 70, in serialize super(Constructor, self).serialize(serializer) File "d:\build_ql_0_9_0\gensrc\gensrc\Functions\function.py", line 128, in serialize serializer.serializeObject(self, parameterlist.ParameterList) File "d:\build_ql_0_9_0\gensrc\gensrc\Serialization\xmlreader.py", line 119, in serializeObject objectInstance.serialize(self) File "d:\build_ql_0_9_0\gensrc\gensrc\Parameters\parameterlist.py", line 89, in serialize serializer.serializeObjectList(self, parameter.Parameter) File "d:\build_ql_0_9_0\gensrc\gensrc\Serialization\xmlreader.py", line 134, in serializeObjectList objectInstance.postSerialize() File "d:\build_ql_0_9_0\gensrc\gensrc\Parameters\parameter.py", line 143, in postSerialize raise exceptions.ParameterNameCapitalizationException(self.name_) > <<<<<<<<<< END STACK TRACE <<<<<<<<<< > > gensrc error: > > The string "quote" is not a valid parameter name - > All parameter names must begin with an uppercase letter. > NMAKE : fatal error U1077: '..\..\gensrc\gensrc.py' : return code '0x1' Stop. Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions" ------------------------------------------------------------------------------------------------------------------------------ Any help? Thanks in advance! Cheers, Max ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Hi Max,
> Hi Eric, Nicola, > > Thanks for your quick help and explanation! Now the code generation works after changing "quote" to "Quote" in stock.xml. > > But I failed to compile "QuantLibAddin/qlo/stock.cpp" and > "QuantLibXL/qlxl/Functions/stock.cpp". The tutorial was out of date in places with respect to release 0.9.0. I have updated the document, please try again and let us know if you have any further problems. Regards, Eric ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Hi Eric, Nicola,
On Feb 8, 2008 8:21 PM, Eric Ehlers <[hidden email]> wrote: > The tutorial was out of date in places with respect to release 0.9.0. I > have updated the document, please try again and let us know if you have > any further problems. Yes, both of your solutions resolved the compilation problem. I managed to re-build QuantLibXL successfully. However, after reloading the XLL "QuantLibXL-vc80-mt-s-0_9_0.xll" in Excel, the "=qlStock("my_stock",1.23)" only returns "#NAME?". It seems that the function "qlStock" is not recognised. I guess I must have missed out some important steps... Any hint? Thanks in advance! Cheers, Max ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Hi Max,
> However, after reloading the XLL "QuantLibXL-vc80-mt-s-0_9_0.xll" in > Excel, the "=qlStock("my_stock",1.23)" only returns "#NAME?". It seems > that the function "qlStock" is not recognised. Are you sure that the XLL you loaded is the one with the new function compiled in? What result do you get from this? =qlxlVersion(TRUE) The timestamp should correspond to the creation date of the XLL. For example for the binary release of QLXL I get QuantLibXL 0.9.0 - MS VC++ 8.0 - Multithreaded Static Runtime library - Release Configuration - Jan 23 2008 18:20:22 Regards, Eric ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Hi Eric,
Thank you very much for the quick help! My mistake: I forgot the proper procedure of loading the new add-in in Excel 2003. I have to deselect the old one from the add-in menu, exit Excel, re-open Excel, and then load the new add-in. Now everything works fine. I also successfully added a new function "qlMCPricingEngine()" which creates a crude monte carlo pricing engine object. And I am happy to contribute more QuantLibXL functions if needed. Thanks! Cheers, Max On Feb 10, 2008 9:31 PM, Eric Ehlers <[hidden email]> wrote: > Hi Max, > > > However, after reloading the XLL "QuantLibXL-vc80-mt-s-0_9_0.xll" in > > Excel, the "=qlStock("my_stock",1.23)" only returns "#NAME?". It seems > > that the function "qlStock" is not recognised. > > Are you sure that the XLL you loaded is the one with the new function > compiled in? What result do you get from this? > > =qlxlVersion(TRUE) > > The timestamp should correspond to the creation date of the XLL. For > example for the binary release of QLXL I get > > QuantLibXL 0.9.0 - MS VC++ 8.0 - Multithreaded Static Runtime library - > Release Configuration - Jan 23 2008 18:20:22 > > Regards, > Eric > > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Max,
if you own the copyright to the files you've used to extend QLXL and want to contribute them just send them to me or Eric. ciao -- Nando On Sun, Feb 10, 2008 at 3:44 PM, Max <[hidden email]> wrote: > Hi Eric, > > Thank you very much for the quick help! > > My mistake: I forgot the proper procedure of loading the new add-in in > Excel 2003. I have to deselect the old one from the add-in menu, exit > Excel, re-open Excel, and then load the new add-in. > > Now everything works fine. I also successfully added a new function > "qlMCPricingEngine()" which creates a crude monte carlo pricing engine > object. And I am happy to contribute more QuantLibXL functions if > needed. Thanks! > > Cheers, > Max > > > > On Feb 10, 2008 9:31 PM, Eric Ehlers <[hidden email]> wrote: > > Hi Max, > > > > > However, after reloading the XLL "QuantLibXL-vc80-mt-s-0_9_0.xll" in > > > Excel, the "=qlStock("my_stock",1.23)" only returns "#NAME?". It seems > > > that the function "qlStock" is not recognised. > > > > Are you sure that the XLL you loaded is the one with the new function > > compiled in? What result do you get from this? > > > > =qlxlVersion(TRUE) > > > > The timestamp should correspond to the creation date of the XLL. For > > example for the binary release of QLXL I get > > > > QuantLibXL 0.9.0 - MS VC++ 8.0 - Multithreaded Static Runtime library - > > Release Configuration - Jan 23 2008 18:20:22 > > > > Regards, > > Eric > > > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > QuantLib-dev mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Free forum by Nabble | Edit this page |