Login  Register

Re: Tutorial to use ObjectHandler outside of QuantLibXL

Posted by Eric Ehlers-3 on Aug 24, 2015; 4:10pm
URL: http://quantlib.414.s1.nabble.com/Tutorial-to-use-ObjectHandler-outside-of-QuantLibXL-tp16776p16845.html

I think you need to link to ObjectHandler.  It appears that you have
specified the library directory correctly, but you also need to link to
the library.

There are 3 ways you can do this (pick one):

1) If your project is in the same solution as ObjectHandler, you can
make your project dependent on ObjectHandler.  This is how the
ExampleCpp project does it.

2) In the project properties under linker input you can specify the
name of the ObjectHandler lib file.

3) You can add this to your source code file:

#include <oh/auto_link.hpp>

Kind Regards,
Eric

On Sun, 23 Aug 2015 06:54:22 -0700 (MST)
Lisa Ann <[hidden email]> wrote:

> If I run your code, build fails due to:
>
> +------------------------------------------------------------------
> | C:\Program
> Files\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(268,5):
> error MSB6006: "link.exe" exited with code 1120.
> | main.obj : error LNK2001: unresolved external symbol "public:
> static class ObjectHandler::Repository & __cdecl
> ObjectHandler::Repository::instance(void)"
> (?instance@Repository@ObjectHandler@@SAAAV12@XZ)
> | main.obj : error LNK2001: unresolved external symbol "public:
> virtual __thiscall ObjectHandler::Repository::~Repository(void)"
> (??1Repository@ObjectHandler@@UAE@XZ)
> | main.obj : error LNK2001: unresolved external symbol "public:
> __thiscall ObjectHandler::Repository::Repository(void)"
> (??0Repository@ObjectHandler@@QAE@XZ)
> | C:\...\Release\MyObjectHandler.exe : fatal error LNK1120: 3
> unresolved externals
> +------------------------------------------------------------------
>
> If you are able to build it, I guess that something must be wrong in
> my project VC++ Directories; here is my setup:
>
> - Include Directories:
> *C:\DevTools\ObjectHandler\;c:\DevTools\boost_1_54_0\;c:\DevTools\QuantLib-1.3\;$(IncludePath)*
> - Library Directories:
> *C:\DevTools\ObjectHandler\lib\;C:\DevTools\log4cxx\msvc\lib\;c:\DevTools\boost_1_54_0\lib32-msvc-10.0\;c:\DevTools\QuantLib-1.3\lib\;$(LibraryPath)*
>
>
>
> --
> View this message in context:
> http://quantlib.10058.n7.nabble.com/Tutorial-to-use-ObjectHandler-outside-of-QuantLibXL-tp16776p16832.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users


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