gpt4 book ai didi

c++ - 在启用 C++ 的 OSX 10.9 上编译 GMP 库

转载 作者:太空宇宙 更新时间:2023-11-04 14:05:02 25 4
gpt4 key购买 nike

我无法在 OSX 10.9 上编译 GMP。我不完全确定,如果问题是 OSX 10.9 特定的,但发生的情况是编译成功但 make check 失败。

请注意,如果我不使用--enable-cxx 编译和make check 都成功。

完整的错误是:

c++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../tests    -O2 -pedantic -fomit-frame-pointer -m64 -mtune=corei7 -march=corei7 -c -o t-cast.o t-cast.cc
brew: superenv removed: -O2 -pedantic -m64 -mtune=corei7 -march=corei7
In file included from t-cast.cc:20:
In file included from ../../gmp.h:51:
/Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cstddef:51:9: error: no member named
'ptrdiff_t' in the global namespace
using ::ptrdiff_t;
~~^
In file included from t-cast.cc:21:
In file included from ../../gmpxx.h:29:
In file included from /Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:594:
In file included from /Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:596:
/Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:386:13: error: unknown type name
'ptrdiff_t'
typedef ptrdiff_t difference_type;
^
/Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:413:56: error: unknown type name
'ptrdiff_t'
template<class _Category, class _Tp, class _Distance = ptrdiff_t, ^/Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:720:66: error: unknown type name
'ptrdiff_t' class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
^
/Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:720:54: error: template parameter
missing a default argument
class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
^
/Applications/Xcode5-DP2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:720:27: note: previous default
template argument defined here class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>

最佳答案

删除gmp.h 中的__need_size_t define 和undef。它也会导入 ptrdiff_t,而不仅仅是 size_t

关于c++ - 在启用 C++ 的 OSX 10.9 上编译 GMP 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17417978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com