【问题标题】:Eclipse + Cygwin + Make: Windows path problemsEclipse + Cygwin + Make:Windows 路径问题
【发布时间】:2013-06-21 20:48:13
【问题描述】:

在 Eclipse 和 Cygwin shell 中为 Cygwin C 项目运行 make 时,我遇到了不同的行为。

问题是路径名被转换为 Windows 路径。

我的生成文件:

all:
    pwd
    cd .; pwd

在 Cygwin shell 中运行 make(正确):

pwd
/cygdrive/c/myproject
cd .; pwd
/cygdrive/c/myproject

在 CDT 中运行构建(来自现有代码的新 Makefile 项目,Cygwin 工具链):

make all 
pwd
/cygdrive/c/myproject
cd .; pwd
C:\myproject

它看到使用“。” (或“..”)导致路径“转换”为 Windows 路径。有什么建议吗?

【问题讨论】:

  • 你能给我们一些输出吗?
  • 我已经包含了在 cygwin shell 下构建和从 Eclipse 构建的输出。有缺陷的输出是 'C:\myproject'

标签: eclipse makefile cygwin


【解决方案1】:

复合命令cd .; pwd可能是通过shell子进程执行的,所以这个shell进程可能有不同的$PATH变量集。如果您的$PATH 中有另一个pwd,它将被称为cygwin 的。例如,来自 gnuwin32 的 pwd 打印窗口的样式路径。

【讨论】:

    【解决方案2】:

    两件事,如果您要运行脚本,请使用 shebang

    #!/usr/bin/bash
    

    其次,你需要知道的关于这个特定主题的一切似乎都在这里,而且是免费的:

    http://oreilly.com/catalog/make3/book/ch07.pdf

    使用类似的东西

    cygpath `pwd`
    

    改为

    【讨论】:

      猜你喜欢
      • 2011-06-28
      • 1970-01-01
      • 2011-08-01
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-03
      • 2011-02-01
      相关资源
      最近更新 更多