如何加载具有附着力的库?

时间:2016-06-07 05:16:29

标签: c++ cling

这可能不是一个棘手的问题,我是一个C ++新手。

我正试图在附着REPL中使用名为QuantLib的库。

我可以通过

在GCC中加载库
#include "ql/quantlib.hpp"

然后使用-lQuantLib进行编译。

我坚持尝试下面3行的排列:

.I "ql/quantlib.hpp"
#include "ql/quantlib.hpp"
.L QuantLib

如果我先运行#include,我会收到很长的错误,包括

等内容
You are probably missing the definition of
QuantLib::AbcdAtmVolCurve::accept(QuantLib::AcyclicVisitor&) Maybe you
need to load the corresponding shared library?

但如果我跑

.I "ql/quantlib.hpp"
#include "ql/quantlib.hpp"
然后一切似乎都很好。

.L Quantlib会产生

input_line_4:1:10: fatal error: 'QuantLib' file not found
#include "QuantLib"

无论何时运行。

我在kfsone的评论

之后尝试了以下内容
.L /usr/lib/libQuantLib.so
#include "ql/quantlib.hpp"

这会给出一个简短的错误!

IncrementalExecutor::executeFunction: symbol '_ZN8QuantLib5ErrorC1ERKSslS2_S2_' unresolved while linking function '__cxx_global_var_init34'!
You are probably missing the definition of QuantLib::Error::Error(std::string const&, long, std::string const&, std::string const&)
Maybe you need to load the corresponding shared library?

0 个答案:

没有答案