I tried compiling my asm .s file in the terminal of VSC and it didn't work although it worked just yesterday :(
我试着在VSC的终端中编译我的ASM.s文件,但它不起作用,尽管它昨天才起作用:(
The code:
代码:
.global main
main:
pushq %rbp
movq %rsp, %rbp
movq %rbp, %rsp
popq %rbp
end:
movq $0, %rdi
call exit
What I entered in terminal:
我在终端中输入的内容:
PS C:\Users\runan\Desktop\x86> gcc -no-pie -o power power.s
The error message I got:
我收到的错误消息是:
gcc : The term 'gcc' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
+ gcc -no-pie -o power power.s
+ ~~~
+ CategoryInfo : ObjectNotFound: (gcc:String) [], Comman
dNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I checked and the file is in the folder. I tried set Path= ... command and then gcc -v but it didn't work either.
我查过了,文件在文件夹里。我试着设置PATH=...司令部,然后是GCC-v,但它也没有奏效。
更多回答
You need to run this command from the WSL shell, not the Powershell.
您需要从WSL外壳而不是Power外壳运行该命令。
优秀答案推荐
我是一名优秀的程序员,十分优秀!