如何在 Windows 上确定是否安装了 C/C++ 编译器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41933927/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 15:28:30  来源:igfitidea点击:

How to determine on Windows whether a C/C++ compiler is installed

c++cwindowswindows-console

提问by jesusperaltac

Before installing a C/C++ compiler on Windows 7 to start coding, I would like to determine whether there is already a compiler installed.

在 Windows 7 上安装 C/C++ 编译器开始编码之前,我想确定是否已经安装了编译器。

Do you know a command on Windows that I could use in the console to do that?

你知道我可以在控制台中使用的 Windows 命令吗?

采纳答案by Lightness Races in Orbit

There is no catch-all way to discover whether there is "a" C or C++ compiler installed, because different compilers are invoked in different ways. You could iterate through the common ones (e.g. running g++from shell) but, really, you should know what software is running on your computer because you installed it. If you did not set up the computer, ask the person who did.

没有万能的方法来发现是否安装了“一个”C 或 C++ 编译器,因为不同的编译器以不同的方式调用。您可以遍历常见的(例如g++从 shell运行),但实际上,您应该知道您的计算机上正在运行什么软件,因为您安装了它。如果您没有设置计算​​机,请询问设置计算机的人。