macで初めてc++を動作させようとしています.
しかし, 下記エラーが発生しコンパイルができません.
エラー内容を見るとNTL/ZZ.hやSmartPtr.h, tools.h, vector.hでエラーが発生しているようですが,対応策が分からないため教えていただきたいです.
console
1In file included from DKSIDFT.cpp:1: 2In file included from /usr/local/include/NTL/ZZ.h:19: 3/usr/local/include/NTL/tools.h:663:18: warning: variadic templates are a C++11 extension [-Wc++11-extensions] 4 template<class... Args> 5 ^ 6/usr/local/include/NTL/tools.h:664:20: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 7 DerivedNode(Args&&... args) : t(std::forward<Args>(args)...) { } 8 ^ 9/usr/local/include/NTL/tools.h:668:22: error: expected function body after function declarator 10delete_node(Node *p) noexcept { delete p; } 11 ^ 12/usr/local/include/NTL/tools.h:705:28: error: unknown type name 'delete_list' 13 static key_wrapper wkey(delete_list); 14 ^ 15/usr/local/include/NTL/tools.h:705:4: error: function declared in block scope cannot have 'static' storage class 16 static key_wrapper wkey(delete_list); 17 ^ 18/usr/local/include/NTL/tools.h:715:7: error: use of undeclared identifier 'delete_node' 19 delete_node(p); 20 ^ 21/usr/local/include/NTL/tools.h:1064:1: error: unknown type name 'constexpr' 22constexpr bool Relocate_aux_has_trivial_copy(T*) 23^ 24/usr/local/include/NTL/tools.h:1072:1: error: unknown type name 'constexpr' 25constexpr bool Relocate_aux_has_any_copy(T*) 26^ 27/usr/local/include/NTL/tools.h:1140:1: error: unknown type name 'constexpr' 28constexpr bool DeclareRelocatableType(T*) 29^ 30In file included from DKSIDFT.cpp:1: 31In file included from /usr/local/include/NTL/ZZ.h:20: 32/usr/local/include/NTL/vector.h:211:11: error: unknown type name 'constexpr' 33 static constexpr bool relocatable = DeclareRelocatableType((T*)0); 34 ^ 35/usr/local/include/NTL/vector.h:212:11: error: unknown type name 'constexpr' 36 static constexpr bool copyable = Relocate_aux_has_any_copy((T*)0); 37 ^ 38/usr/local/include/NTL/vector.h:248:11: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 39 Vec(Vec&& a) NTL_FAKE_NOEXCEPT 40 ^ 41/usr/local/include/NTL/vector.h:248:16: error: expected ';' at end of declaration list 42 Vec(Vec&& a) NTL_FAKE_NOEXCEPT 43 ^ 44 ; 45/usr/local/include/NTL/vector.h:465:20: error: unknown type name 'constexpr' 46template <class T> NTL_DECLARE_RELOCATABLE((Vec<T>*)) 47 ^ 48/usr/local/include/NTL/tools.h:1163:36: note: expanded from macro 'NTL_DECLARE_RELOCATABLE' 49#define NTL_DECLARE_RELOCATABLE(x) NTL_DECLARE_RELOCATABLE_WHEN(x) \ 50 ^ 51/usr/local/include/NTL/tools.h:1045:41: note: expanded from macro 'NTL_DECLARE_RELOCATABLE_WHEN' 52#define NTL_DECLARE_RELOCATABLE_WHEN(x) \ 53 ^ 54In file included from DKSIDFT.cpp:1: 55In file included from /usr/local/include/NTL/ZZ.h:20: 56/usr/local/include/NTL/vector.h:838:14: error: out-of-line definition of 'kill' does not match any declaration in 'Vec<T>' 57void Vec<T>::kill() 58 ^~~~ 59In file included from DKSIDFT.cpp:1: 60In file included from /usr/local/include/NTL/ZZ.h:21: 61/usr/local/include/NTL/SmartPtr.h:296:21: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 62 SmartPtr(SmartPtr&& other) noexcept : dp(other.dp), cp(other.cp) 63 ^ 64/usr/local/include/NTL/SmartPtr.h:296:30: error: expected ';' at end of declaration list 65 SmartPtr(SmartPtr&& other) noexcept : dp(other.dp), cp(other.cp) 66 ^ 67 ; 68/usr/local/include/NTL/SmartPtr.h:363:20: error: unknown type name 'constexpr' 69template <class T> NTL_DECLARE_RELOCATABLE((SmartPtr<T>*)) 70 ^ 71/usr/local/include/NTL/tools.h:1163:36: note: expanded from macro 'NTL_DECLARE_RELOCATABLE' 72#define NTL_DECLARE_RELOCATABLE(x) NTL_DECLARE_RELOCATABLE_WHEN(x) \ 73 ^ 74/usr/local/include/NTL/tools.h:1045:41: note: expanded from macro 'NTL_DECLARE_RELOCATABLE_WHEN' 75#define NTL_DECLARE_RELOCATABLE_WHEN(x) \ 76 ^ 77In file included from DKSIDFT.cpp:1: 78In file included from /usr/local/include/NTL/ZZ.h:21: 79/usr/local/include/NTL/SmartPtr.h:539:29: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 80 CloneablePtr(CloneablePtr&& other) noexcept : dp(other.dp), cp(other.cp) 81 ^ 82/usr/local/include/NTL/SmartPtr.h:539:38: error: expected ';' at end of declaration list 83 CloneablePtr(CloneablePtr&& other) noexcept : dp(other.dp), cp(other.cp) 84 ^ 85 ; 86/usr/local/include/NTL/SmartPtr.h:616:19: error: unknown type name 'constexpr' 87template<class T> NTL_DECLARE_RELOCATABLE((CloneablePtr<T>*)) 88 ^ 89/usr/local/include/NTL/tools.h:1163:36: note: expanded from macro 'NTL_DECLARE_RELOCATABLE' 90#define NTL_DECLARE_RELOCATABLE(x) NTL_DECLARE_RELOCATABLE_WHEN(x) \ 91 ^ 92/usr/local/include/NTL/tools.h:1045:41: note: expanded from macro 'NTL_DECLARE_RELOCATABLE_WHEN' 93#define NTL_DECLARE_RELOCATABLE_WHEN(x) \ 94 ^ 95In file included from DKSIDFT.cpp:1: 96In file included from /usr/local/include/NTL/ZZ.h:21: 97/usr/local/include/NTL/SmartPtr.h:666:18: warning: variadic templates are a C++11 extension [-Wc++11-extensions] 98 template<class... Args> 99 ^ 100/usr/local/include/NTL/SmartPtr.h:667:21: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 101 MakeSmartAux(Args&&... args) : d(std::forward<Args>(args)...) { } 102 ^ 103/usr/local/include/NTL/SmartPtr.h:670:24: warning: variadic templates are a C++11 extension [-Wc++11-extensions] 104template<class T, class... Args> 105 ^ 106/usr/local/include/NTL/SmartPtr.h:671:27: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 107SmartPtr<T> MakeSmart(Args&&... args) 108 ^ 109/usr/local/include/NTL/SmartPtr.h:684:18: warning: variadic templates are a C++11 extension [-Wc++11-extensions] 110 template<class... Args> 111 ^ 112/usr/local/include/NTL/SmartPtr.h:685:25: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 113 MakeCloneableAux(Args&&... args) : d(std::forward<Args>(args)...) { } 114 ^ 115/usr/local/include/NTL/SmartPtr.h:708:24: warning: variadic templates are a C++11 extension [-Wc++11-extensions] 116template<class T, class... Args> 117 ^ 118/usr/local/include/NTL/SmartPtr.h:709:16: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 119T* MakeRaw(Args&&... args) { 120 ^ 121/usr/local/include/NTL/SmartPtr.h:718:24: warning: variadic templates are a C++11 extension [-Wc++11-extensions] 122template<class T, class... Args> 123 ^ 124/usr/local/include/NTL/SmartPtr.h:719:35: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 125CloneablePtr<T> MakeCloneable(Args&&... args) 126 ^ 127/usr/local/include/NTL/SmartPtr.h:1082:23: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 128 UniquePtr(UniquePtr&& other) noexcept : UniquePtr() 129 ^ 130/usr/local/include/NTL/SmartPtr.h:1082:32: error: expected ';' at end of declaration list 131 UniquePtr(UniquePtr&& other) noexcept : UniquePtr() 132 ^ 133 ; 134/usr/local/include/NTL/SmartPtr.h:1152:28: error: unknown type name 'constexpr' 135template<class T, class P> NTL_DECLARE_RELOCATABLE((UniquePtr<T,P>*)) 136 ^ 137/usr/local/include/NTL/tools.h:1163:36: note: expanded from macro 'NTL_DECLARE_RELOCATABLE' 138#define NTL_DECLARE_RELOCATABLE(x) NTL_DECLARE_RELOCATABLE_WHEN(x) \ 139 ^ 140/usr/local/include/NTL/tools.h:1045:41: note: expanded from macro 'NTL_DECLARE_RELOCATABLE_WHEN' 141#define NTL_DECLARE_RELOCATABLE_WHEN(x) \ 142 ^ 143In file included from DKSIDFT.cpp:1: 144In file included from /usr/local/include/NTL/ZZ.h:21: 145/usr/local/include/NTL/SmartPtr.h:1265:23: warning: rvalue references are a C++11 extension [-Wc++11-extensions] 146 CopiedPtr(CopiedPtr&& other) noexcept : CopiedPtr() 147 ^ 148/usr/local/include/NTL/SmartPtr.h:1265:32: error: expected ';' at end of declaration list 149 CopiedPtr(CopiedPtr&& other) noexcept : CopiedPtr() 150 ^ 151 ; 152fatal error: too many errors emitted, stopping now [-ferror-limit=] 15317 warnings and 20 errors generated.
以下,利用しているg++コンパイラ情報です.
$ g++ --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.3 (clang-1103.0.32.62) Target: x86_64-apple-darwin19.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
なおソースコードについては,著作権に関する事情から掲載することができません.
よろしくお願いいたします.