C++ 我在哪里可以在 Windows 上设置 make.exe 的路径?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1618280/
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-27 20:38:16  来源:igfitidea点击:

Where can I set path to make.exe on Windows?

c++registrymakefilepathmsys

提问by d9k

When I try run makefrom cmd-console on Windows, it runs Turbo Delphi's make.exebut I need MSYS's make.exe. There is no mention about Turbo Delphi in %path%variable, maybe I can change it to MSYS in registry? Please, help.

当我尝试make在 Windows 上从 cmd-console 运行时,它运行 Turbo Delphi,make.exe但我需要 MSYS 的make.exe. %path%变量中没有提到Turbo Delphi ,也许我可以在注册表中将其更改为MSYS?请帮忙。

回答by Natalie Adams

The path is in the registry but usually you edit through this interface:

该路径在注册表中,但通常您通过此界面进行编辑:

  1. Go to Control Panel-> System-> System settings-> Environment Variables.
  2. Scroll down in system variables until you find PATH.
  3. Click edit and change accordingly.
  4. BE SURE to include a semicolon at the end of the previous as that is the delimiter, i.e. c:\path;c:\path2
  5. Launch a new console for the settings to take effect.
  1. Control Panel-> System-> System settings-> Environment Variables
  2. 在系统变量中向下滚动,直到找到PATH.
  3. 单击编辑并进行相应更改。
  4. 确保在前一个末尾包含一个分号,因为它是分隔符,即 c:\path;c:\path2
  5. 启动一个新的控制台以使设置生效。

回答by 24x7Cloud Services

here I'm providing solution to setup terraform enviroment variable in windows to beginners.

在这里,我为初学者提供了在 Windows 中设置 terraform 环境变量的解决方案。

  1. Download the terraform package from portal either 32/64 bit version.
  2. make a folder in C drive in program files if its 32 bit package you have to create folder inside on programs(x86) folder or else inside programs(64 bit) folder.
  3. Extract a downloaded file in this location or copy terraform.exe file into this folder. copy this path location like C:\Programfile\terraform\
  4. Then got to Control Panel -> System -> System settings -> Environment Variables
  1. 从门户网站下载 terraform 包 32/64 位版本。
  2. 在程序文件的 C 驱动器中创建一个文件夹,如果它的 32 位包您必须在程序(x86)文件夹中或在程序(64 位)文件夹中创建文件夹。
  3. 在此位置解压下载的文件或将 terraform.exe 文件复制到此文件夹中。复制此路径位置,如 C:\Programfile\terraform\
  4. 然后进入控制面板 -> 系统 -> 系统设置 -> 环境变量

Open system variables, select the path > edit > new > place the terraform.exe file location like > C:\Programfile\terraform\

打开系统变量,选择路径>编辑>新建>放置terraform.exe文件位置如> C:\Programfile\terraform\

and Save it.

并保存它。

  1. Open new terminal and now check the terraform.
  1. 打开新终端,现在检查地形。

回答by Mladen Milunovic

Or you can just run power-shell command to append extra folder to the existing path:

或者您可以运行 power-shell 命令将额外的文件夹附加到现有路径:

$env:Path += ";C:\temp\terraform" 

回答by Alex Thomas

I had issues for a whilst not getting Terraform commands to run unless I was in the directory of the exe, even though I set the path correctly.

我有一段时间没有让 Terraform 命令运行,除非我在 exe 的目录中,即使我正确设置了路径。

For anyone else finding this issue, I fixed it by moving the environment variable higher than others!

对于发现此问题的其他任何人,我通过将环境变量移至高于其他变量来修复它!

回答by Remus Rigo

Why don't you create a bat file makedos.batcontaining the following line?

为什么不创建一个makedos.bat包含以下行的 bat 文件?

c:\DOS\make.exe %1 %2 %5

and put it in C:\DOS(or C:\Windowsè or make sure that it is in your %path%)

并将其放入C:\DOS(或C:\Windowsè 或确保它在您的 中%path%

You can run from cmd, SET and it displays all environment variables, including PATH.

您可以从 cmd、SET 运行,它会显示所有环境变量,包括 PATH。

In registry you can find environment variables under:

在注册表中,您可以在以下位置找到环境变量:

  • HKEY_CURRENT_USER\Environment
  • HKEY_CURRENT_USER\Volatile Environment
  • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment
  • HKEY_CURRENT_USER\Environment
  • HKEY_CURRENT_USER\Volatile Environment
  • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment