Visual Studio Code가 터미널에서 코드를 실행하지 않습니다.

Visual Studio Code가 터미널에서 코드를 실행하지 않습니다.

C 코드를 실행하려고 하는데 원하는 출력 대신 터미널에 이 메시지가 계속 나타납니다.

Windows 명령 프롬프트를 통해 코드를 실행하면 MinGW가 작동할 수 있기 때문에 MinGW를 잘못 설치하는 것(또는 vscode에 잘못된 경로를 넣는 것)과 관련이 있다고 생각합니다.

프로그래밍에 비교적 익숙하지 않기 때문에 이해가 되지 않는다면 죄송합니다. 코드를 실행하려고 할 때 터미널에서 알려주는 내용은 다음과 같습니다.

PS P:\comp sci\projects> cd "p:\comp sci\projects\" ; if ($?) { gcc CW714a.c -o CW714a } ; if ($?) { .\CW714a }
p:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: p:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
C:\temp\gcc\build-mingw-w64\mingw-w64-crt/../../src/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
PS P:\comp sci\projects> 

CLI 출력

관련 정보