8
我剛剛更新我的拱linux系統到最新,其中包括gcc 7.1.1。試圖建立這樣的:使用命令鏗鏘4建立在<functional>錯誤與c + + 1z
clang++ main.cpp -std=c++1z
導致錯誤
#include <functional>
int main(int argc, char** argv) {
return 1;
}
:
In file included from main.cpp:1:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/functional:60:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/unordered_map:47:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/bits/hashtable.h:37:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/bits/node_handle.h:39:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:1032:27: error: use of class template 'optional'
requires template arguments
template <typename _Tp> optional(_Tp) -> optional<_Tp>;
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:451:11: note: template is declared here
class optional
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:1032:40: error: expected ';' at end of declaration
template <typename _Tp> optional(_Tp) -> optional<_Tp>;
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:1032:41: error: cannot use arrow operator on a type
template <typename _Tp> optional(_Tp) -> optional<_Tp>;
這是由於我的錯誤,Arch Linux的,或鐺?
更新:(忘了補充版本)
- GCC軟件包版本7.1.1-2(提供的/ usr /包括/ C++ DIR)
- 鐺軟件包版本4.0.0-3
看起來像鐺只是不支持演繹指南呢。 – Barry
啊,我沒有意識到這是發生了什麼(並忘記作爲c + + 17的功能)。謝謝! – ryan0270
此處同樣的錯誤。你有沒有找到任何解決方法?我發現的唯一一個是切換到g ++ .. –