vscode wsl 安装gcc却运行不了g++ -o -wall

在vscode的wsl2终端输入 g++ -g –Wall –o test test.cpp
结果报错
g++: error: –Wall: No such file or directory
g++: error: –o: No such file or directory
g++: error: test: No such file or directory
请问是什么原因

–Wall 和-o前面的-需要用英文的-,你用成中文的了

g++ -g -Wall -o test test.cpp

环境没配好。
检查一下环境。