Login  Register

Re: Tutorial to use ObjectHandler outside of QuantLibXL

Posted by Eric Ehlers-3 on Aug 20, 2015; 2:45pm
URL: http://quantlib.414.s1.nabble.com/Tutorial-to-use-ObjectHandler-outside-of-QuantLibXL-tp16776p16827.html

Hello,

> 1 rebuild out of 14 fails, and I think that comes from here:
>
> +------------------------------------------------------------------
> | NMAKE : fatal error U1077: 'doxygen.exe' : return code '0x1'

You can ignore that, it's to build the documentation (the same as the
web site), or you can install doxygen.

> This fails due to:
>
> +------------------------------------------------------------------
> | main.obj : error LNK2001: unresolved external symbol
> | "public: static class ObjectHandler::Repository & __cdecl
> ObjectHandler::Repository::instance(void)"
> | (?instance@Repository@ObjectHandler@@SAAAV12@XZ)
> | C:\...\MyObjectHandler.exe : fatal error LNK1120: 1 unresolved
> externals
> +------------------------------------------------------------------
>
> I don't think this is linked to the previous build failure, this seems
> related to singleton declaration of something static...

That's right, you need to instantiate the Repository singleton before
you can call any of its functions.  It doesn't have to be static, it
just has to persist for as long as your program uses it.

You could put this at the top of your main function:

ObjectHandler::Repository repository;

Please have a look at the ExampleCpp project.

https://github.com/eehlers/quantlib/blob/master/ObjectHandler/Examples/C%2B%2B/example.cpp

Kind Regards,
Eric

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users