In file included from /home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/cppproblem1.cpp:11:0:
/home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/commoncppproblem1.h: In constructor ‘ListNode::ListNode()’:
/home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/commoncppproblem1.h:13:31: error: ‘nullptr’ was not declared in this scope
ListNode() : val(0), next(nullptr) {}
/home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/commoncppproblem1.h:33:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
vector list{};
^
/home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/commoncppproblem1.h:33:31: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
vector list{};
这是我粘贴的一些报错信息, 应该编译选项不支持c++11, 但是不知道如何解决
Your Environment
os: Linux ws-System-Product-Name 4.15.0-142-generic #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
🐛 Bug Report
In file included from /home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/cppproblem1.cpp:11:0: /home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/commoncppproblem1.h: In constructor ‘ListNode::ListNode()’: /home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/commoncppproblem1.h:13:31: error: ‘nullptr’ was not declared in this scope ListNode() : val(0), next(nullptr) {}
/home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/commoncppproblem1.h:33:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 vector list{};
^
/home/ws/.config/Code/User/globalStorage/wangtao0101.debug-leetcode/commoncppproblem1.h:33:31: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
vector list{};
这是我粘贴的一些报错信息, 应该编译选项不支持c++11, 但是不知道如何解决
Your Environment