0

我在mac上使用了“brew install ntl”。

如果我在 Xcode 中使用 libc++,我会收到以下链接错误:

架构 x86_64 的未定义符号:“_ntl_gcopy(_ntl_gbigint_body*, _ntl_gbigint_body**)”,引用自:NTL::ZZ::operator=(NTL::ZZ&&) in main.o “_ntl_gfree(_ntl_gbigint_body*)”,引用自: NTL::ZZ::Deleter::apply(_ntl_gbigint_body*) in main.o "_ntl_gsadd(_ntl_gbigint_body*, long, _ntl_gbigint_body**)",引用自:NTL::add(NTL::ZZ&, NTL::ZZ const& , long) in main.o "_ntl_gmul(_ntl_gbigint_body*, _ntl_gbigint_body*, _ntl_gbigint_body**)",引用自:NTL::mul(NTL::ZZ&, NTL::ZZ const&, NTL::ZZ const&) in main。 o "NTL::operator<<(std::__1::basic_ostream >&, NTL::ZZ const&)",引用自:main.o 中的 _main"NTL::operator>>(std::__1::basic_istream >&, NTL::ZZ&)",引用自:main.old 中的 _main:未找到架构 x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

如果我切换到 libstdc++,如下所示:GCC 4.7/4.8 作为 Xcode 的 C/C++ 编译器,我会得到 'type_traits' 文件未找到。然而,确实解决了其他链接器错误。

否则如何在 Xcode 中使用 NTL 库?我是否必须添加“其他链接器标志”,如果需要,如何添加以及添加哪些?

NTL 版本 11.1.0

4

0 回答 0