powershell 我是初学者,代码不会编译,我正在尝试用VisualStudio代码进行编程,我不知道有什么问题?

b4lqfgs4  于 2022-11-10  发布在  Shell
关注(0)|答案(1)|浏览(157)

# include<stdio.h>

int main() {      

    printf("my name is Lakpa Titung");     
    return 0;      
}
Windows PowerShell Copyright (C) Microsoft Corporation. All rights
reserved.

Install the latest PowerShell for new features and improvements!
https://aka.ms/PSWindows

PS C:\Users\user\C programming> gcc coading.c
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
PS C:\Users\user\C programming> ./a.exe
./a.exe : The term './a.exe' 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
+ ./a.exe
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (./a.exe:String) [], CommandNotFoundException       
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\user\C programming>
ruarlubt

ruarlubt1#

您的代码是完全正确的,但在编译时它会显示如下错误:Windows PowerShell版权所有(C)Microsoft Corporation。版权所有。
安装最新的PowerShell以获得新功能和改进!https://aka.ms/PSWindows

**然后转到:设置-扩展-运行代码配置-在终端中单击运行,然后在运行前单击保存...

您的设置已完成。重新运行您的代码。

相关问题