这甚至可能不是一个棘手的问题,我是 C++ 新手。
我正在尝试在 cling 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?