【发布时间】:2021-02-28 00:17:15
【问题描述】:
我可以在标准 Windows 控制台中运行“make”或“g++”,但无法在 VSCode 终端中运行它们。
我尝试使用 VSCode 终端运行“make”或“g++”,但找不到这些命令:
C:\CEngineering\VSCpp> make --version
'make' is not recognized as an internal or external command,
operable program or batch file.
C:\CEngineering\VSCpp> g++ --version
'g++' is not recognized as an internal or external command,
operable program or batch file.
但是,标准 Windows 控制台运行良好:
C:\Users\cb> make --version
mingw-get version 0.6.3-pre-20170905-1
Copyright (C) 2009-2013, MinGW.org Project
This is free software; see the product documentation, or source code,
for copying and redistribution conditions. There is NO WARRANTY; not
even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
PARTICULAR PURPOSE.
C:\Users\cb> g++ --version
g++ (MinGW.org GCC Build-2) 9.2.0
Copyright (c) 2019 Free Software Foundation, Inc.
我不知道为什么我不能在 VSCode 终端中运行。我检查了 VSCode 终端设置,它们是 same 程序(C:\WINDOWS\system32\cmd.exe),但结果不同......奇怪
【问题讨论】:
-
如果您的 PATH 中有正确的内容,那么两者都应该可以找到它。
-
安装mingw并更新
PATH后是否重启过VSCode?span> -
是的,我重新启动了,但它仍然不起作用。也许问题在于 VSCode 正在使用一些不同的设置启动其终端。
标签: c++ visual-studio-code g++ mingw32