【问题标题】:Launching devenv from git-bash gives build error从 git-bash 启动 devenv 会产生构建错误
【发布时间】:2020-01-05 18:27:13
【问题描述】:

我需要从 gitbash 启动我的解决方案的构建。我在使用 VS2003 工具集运行的 Visual Studio 2010 上。 为此,我调用了一个 .bat 文件,该文件从 devenv.exe 切换命令构建解决方案。

单独运行 bat 文件就可以了。但是,从 gitbash 运行它会导致构建失败。

bat 文件:

"C:\...pathToDevenv...\IDE\devenv.exe" MySolution.sln /Build "Debug" /out BuildReport.log

从 git-bash 调用:

./compileMySolution.bat

我收到此错误:

error MSB6001: Invalid command line switch for "CL.exe". Item has already been added. Key in dictionary: 'HOME'  Key being added: 'home'

Build FAILED.

我尝试设置主环境变量但失败了。 我在文件 Microsoft.Cpp.Win32.v71.targets(309,5) 中没有发现任何线索。 有人能帮我吗?谢谢

【问题讨论】:

    标签: visual-studio-2010 batch-file visual-c++ git-bash


    【解决方案1】:

    最后我只是在 shell 中取消设置 HOME 变量并将其设置在 .bat 文件中。

    【讨论】:

      猜你喜欢
      • 2020-12-30
      • 2017-11-15
      • 1970-01-01
      • 2021-05-08
      • 1970-01-01
      • 2011-01-01
      • 2019-01-19
      • 1970-01-01
      相关资源
      最近更新 更多