如何使用GRANG加载库? 这可能不是一个紧要的问题,我是C++新手。< /P>
我试图在cling REPL中使用一个名为QuantLib的库 我可以通过执行以下操作在GCC中加载库如何使用GRANG加载库? 这可能不是一个紧要的问题,我是C++新手。< /P>,c++,cling,C++,Cling,我试图在cling REPL中使用一个名为QuantLib的库 我可以通过执行以下操作在GCC中加载库 #include "ql/quantlib.hpp" 然后用-lQuantLib编译 在《粘住》中,我尝试了以下三行的排列: .I "ql/quantlib.hpp" #include "ql/quantlib.hpp" .L QuantLib 如果我先运行#include,我会得到一个很长的错误,包括类似 You are probably missing the definition o
#include "ql/quantlib.hpp"
然后用-lQuantLib
编译
在《粘住》中,我尝试了以下三行的排列:
.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?
Cling需要知道您想要使用的结构/函数的语法,以及执行的二进制代码 对于语法,必须添加include,例如:
#include "myfile.hpp"
#pragma cling load("myfile.so.9.220.0")
对于二进制代码,必须按如下方式加载库:
#include "myfile.hpp"
#pragma cling load("myfile.so.9.220.0")
QuantLib.so或QuantLib.a在哪里?/usr/lib/libQuantLib.so,libQuantLib.so.0