/usr/local/bin:/usr/bin: 到 $PATH 的末尾而不是顶部
我正在尝试使用 MSVC 链接器进行 ICU 代码。但是,启动 Cygwin 会将 /usr/local/bin 和 /usr/bin 放在路径前面,导致 link.exe 始终调用 Cygwin 版本,而不是 MSVC 版本。我该如何解决这个配置问题?目前,我启动 VS 命令提示符,然后启动 cygwin.bat。
/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/Microsoft F#/v4.0:/cygdr ive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VSTSDB/部署:/cygdrive/c /Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/BIN:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/工具:/cygdrive/c/Windows/Microsoft.NET/F ramework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c /Program Files (x86)/Microsoft Visual Studio 10.0/VC/VCPackages:/cygdrive/c/Program Files (x86)/HTML 帮助研讨会:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/团队工具/性能工具:/cygdrive/c/Program Files (x86)/Mic rosoft SDKs/Windows/v7.0A/bin/NETFX 4.0 工具:/cygdrive/c/Program 文件 (x86)/Microsoft SDKs/Windows/v7.0A/bin:/cygdrive/c/Program 文件/公用文件/Microsoft 共享/Windows 直播:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c /Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygd rive/c/程序文件 (x86)/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL 服务器/100/工具/Binn:/cygdrive/c/Program Files/Microsoft SQL 服务器/100/DTS/Binn:/cygdrive/c/Program Files (x86)/Microsoft ASP.NET/ASP.NET 网页/v1.0:/cygdrive/c/Program 文件/TortoiseHg:/cygdrive/c/Program Files (x86)/GtkSharp/2.12/bin:/cygdrive/c/Users/tim/AppData/Roaming/npm:/cygdrive/c/P rogram 文件 (x86)/nodejs:/cygdrive/c/Program Files (x86)/Common 文件/Intuit/QB POSSDKRuntime:/cygdrive/c/Program Files (x86)/Git/cmd
ICU 告诉我
确保 PATH 的顺序是 MSVC、Cygwin、然后是其他 路径。配置脚本需要Cygwin中的某些工具(例如grep)。
更新。我的 cygwin.bat 如下所示:
@回声关闭
C: chdir C:\cygwin\bin
bash --login -i
不是很有帮助。
I'm trying to ICU code using the MSVC linker. However, launching Cygwin places the /usr/local/bin and /usr/bin in front of the path, causing link.exe to always call the Cygwin version, instead of the MSVC version. How can I fix this configuration issue? Currently, I launch the VS command prompt, then launch cygwin.bat.
/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/Microsoft
F#/v4.0:/cygdr ive/c/Program Files (x86)/Microsoft Visual Studio
10.0/VSTSDB/Deploy:/cygdrive/c /Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Progra m Files (x86)/Microsoft
Visual Studio 10.0/VC/BIN:/cygdrive/c/Program Files (x86 )/Microsoft
Visual Studio 10.0/Common7/Tools:/cygdrive/c/Windows/Microsoft.NET/F
ramework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c /Program Files (x86)/Microsoft Visual Studio
10.0/VC/VCPackages:/cygdrive/c/Prog ram Files (x86)/HTML Help Workshop:/cygdrive/c/Program Files (x86)/Microsoft Vis ual Studio
10.0/Team Tools/Performance Tools:/cygdrive/c/Program Files (x86)/Mic rosoft SDKs/Windows/v7.0A/bin/NETFX 4.0 Tools:/cygdrive/c/Program
Files (x86)/Mi crosoft SDKs/Windows/v7.0A/bin:/cygdrive/c/Program
Files/Common Files/Microsoft Shared/Windows
Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c
/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygd
rive/c/Program Files (x86)/Microsoft SQL
Server/100/Tools/Binn:/cygdrive/c/Progr am Files/Microsoft SQL
Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL
Server/100/DTS/Binn:/cygdrive/c/Program Files (x86)/Microsoft
ASP.NET/ASP.N ET Web Pages/v1.0:/cygdrive/c/Program
Files/TortoiseHg:/cygdrive/c/Program Files
(x86)/GtkSharp/2.12/bin:/cygdrive/c/Users/tim/AppData/Roaming/npm:/cygdrive/c/P
rogram Files (x86)/nodejs:/cygdrive/c/Program Files (x86)/Common
Files/Intuit/QB POSSDKRuntime:/cygdrive/c/Program Files (x86)/Git/cmd
ICU tells me to
Ensure that the order of the PATH is MSVC, Cygwin, and then other
PATHs. The configure script needs certain tools in Cygwin (e.g. grep).
Update. My cygwin.bat looks like this:
@echo off
C: chdir C:\cygwin\bin
bash --login -i
Not very helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 Cygwin 的默认安装,PATH 设置为 /etc/profile。您可以修改 PATH,以便附加 /usr/local/bin:/usr/bin 而不是前置。
导致:
For a default installation of Cygwin, PATH is set is /etc/profile. You can modify PATH so that /usr/local/bin:/usr/bin are appended rather than prepended.
Resulting in:
我认为更干净的方法是使用在 Cygwin 的
/etc/profile
中创建的ORIGINAL_PATH
变量。不要修改此文件,而是修改.bashrc
文件以使用ORIGINAL_PATH
,然后附加/usr/local/bin
和/usr /bin
。.bashrc
:那么你就不必修改Cygwin安装文件了。
I think that a cleaner method is to use the
ORIGINAL_PATH
variable that is created in Cygwin’s/etc/profile
. Instead of modifying this file, modify your.bashrc
file to useORIGINAL_PATH
and then append/usr/local/bin
and/usr/bin
..bashrc
:Then you don't have to modify the Cygwin installation files.