Re: Tutorial to use ObjectHandler outside of QuantLibXL
Posted by Lisa Ann on Aug 21, 2015; 12:48pm
URL: http://quantlib.414.s1.nabble.com/Tutorial-to-use-ObjectHandler-outside-of-QuantLibXL-tp16776p16830.html
I had done what you said, that is, instantiating the Repository singleton before calling its functions, during my first attempts... and this was the result:
int main()
{
try
{
ObjectHandler::Repository repository;
makeObject("Object1", "Foo");
char tmp;
std::cin >> tmp;
return 0;
}
catch(...)
{
throw "Exception thrown!";
return 1;
}
}
+------------------------------------------------------------------
| 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
+------------------------------------------------------------------
That's the reason why I tried to not instantiate it before calling its method.