如何在MSYS上访问Windows环境变量? [英] How to access windows enviroment variables on MSYS?

查看:466
本文介绍了如何在MSYS上访问Windows环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过vs2015从msys2构建ffmpeg.

I want to build ffmpeg by vs2015 from msys2.

首先将vs2015 \ vc \ bin \ amd64添加到Windows的路径环境中.

In the first add vs2015\vc\bin\amd64 in to path enviroment in windows.

以管理员身份运行"vs2015 x64命令提示符",然后运行vcvarsall.bat amd64.

Run "vs2015 x64 command prompt" as administrator then run vcvarsall.bat amd64.

最后,转到"msys"路径,然后运行"msys2_shell.cmd".

In the final go to "msys" path and then run "msys2_shell.cmd".

我使用"where cl"命令来本地化cl.exe.

I use "which cl" command for localize cl.exe.

输出:

其中:无提示 (/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell /v1.0/)

which: no cl in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/)

如何在msys中访问Windows环境?

How to access to windows enviroments in the msys ?

推荐答案

遇到同样的问题.

原因:

PATH环境变量未继承到msys2.

The PATH environment variable is not inherited to msys2.

解决方案:

而不是单独运行msys2_shell.cmd,而是使用-use-full-path参数运行它:

Rather than run msys2_shell.cmd alone, run it with a -use-full-path parameter:

 msys2_shell.cmd -use-full-path  

这篇关于如何在MSYS上访问Windows环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆