我无法在 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>