Eclipse + Cygwin + Make:Windows路径问题 [英] Eclipse + Cygwin + Make: Windows path problems

查看:282
本文介绍了Eclipse + Cygwin + Make:Windows路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am experiencing different behavior when running make for a Cygwin C project in Eclipse vs the Cygwin shell.

问题是路径名称正在转换为Windows路径。

The problem is that path names are being converted to windows paths.

我的makefile:

My makefile:

all:
    pwd
    cd .; pwd

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

Running make in Cygwin shell (correct):

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

在CDT中运行构建Code,Cygwin toolchain):

Running build in CDT (New Makefile Project from Existing Code, Cygwin toolchain):

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

它看到使用'。' 。')导致路径被转换为Windows路径。任何建议?

It sees that using '.' (or '..') cause the path to be "converted" to a windows path. Any suggestions?

推荐答案

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

Two things, if you are gonna run scripts, use a shebang

#!/usr/bin/bash

其次,您需要了解的关于这个特定主题的一切内容似乎都是免费的:

Second, everything you need to know on this specific topic seems to be here, for free:

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

使用类似于

cygpath `pwd`

而不是

这篇关于Eclipse + Cygwin + Make:Windows路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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