我遇到了链接库的问题。
我通过 brew 安装了它的一个版本,但后来我发现我需要在构建中添加环境标志:
CXXFLAGS="-stdlib=libstdc++ -mmacosx-version-min=10.6" \
LDFLAGS="-stdlib=libstdc++ -mmacosx-version-min=10.6"
所以我在 opt/local/lib 安装了另一个使用标志构建的版本。我的问题是操作系统仍在使用 brew 安装版本。我已经搜索但无法找到如何将 os 链接到正确构建的库或使用标志构建 brew 版本。
我认为这是问题的原因是,在为 ruby 构建 quantlib-swig 时,我收到以下错误,一些论坛称这些错误与环境标志有关:
creating Makefile
compiling quantlib_wrap.cpp
In file included from quantlib_wrap.cpp:2647:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/quantlib.hpp:47:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/all.hpp:35:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4035:59: error:
'value_type' is a private member of
'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
*> >'
__val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
^
quantlib_wrap.cpp:8228:23: note: while substituting deduced template arguments
into function template 'operator<<' [with _Expr =
boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
*> >]
s << (*self)[i][j];
^
In file included from quantlib_wrap.cpp:2647:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/quantlib.hpp:47:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/all.hpp:35:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4036:46: error:
'value_type' is a private member of
'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
*> >'
__scalar_expr<typename _Expr::value_type>, _Expr> >
^
2 errors generated.
make: *** [quantlib_wrap.o] Error 1