cygwin $'\ r':命令未找到错误

时间:2017-04-29 07:43:28

标签: c cygwin automake

我修改了一个项目,在调试下工作正常。当我尝试在没有调试的情况下构建它时,它显示错误,无法修复它。

        $ make
        Making all in third_party
        make[1]: Entering directory '/cygdrive/c/Users/alimjan/Documents/fast-hlground/slim-2.2.7/third_party'
        Making all in zdelta-2.1
        make[2]: Entering directory '/cygdrive/c/Users/alimjan/Documents/fast-hlground/slim-2.2.7/third_party/zdelta-2.1'
        gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -MT inffast.o -MD -MP -MF .deps/inffast.Tpo -c -o inffast.     o inffast.c
        mv -f .deps/inffast.Tpo .deps/inffast.Po
        gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -MT inflate.o -MD -MP -MF .deps/inflate.Tpo -c -o inflate.     o inflate.c
       mv -f .deps/inflate.Tpo .deps/inflate.Po
       gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -MT inftrees.o -MD -MP -MF .deps/inftrees.Tpo -c -o inftre     es.o inftrees.c
       mv -f .deps/inftrees.Tpo .deps/inftrees.Po
       gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -MT infutil.o -MD -MP -MF .deps/infutil.Tpo -c -o infutil.     o infutil.c
       mv -f .deps/infutil.Tpo .deps/infutil.Po
       gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -MT adler32.o -MD -MP -MF .deps/adler32.Tpo -c -o adler32.     o adler32.c
       mv -f .deps/adler32.Tpo .deps/adler32.Po
       gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -MT zd_mem.o -MD -MP -MF .deps/zd_mem.Tpo -c -o zd_mem.o z     d_mem.c
       mv -f .deps/zd_mem.Tpo .deps/zd_mem.Po
       gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -MT zutil.o -MD -MP -MF .deps/zutil.Tpo -c -o zutil.o zuti     l.c
       mv -f .deps/zutil.Tpo .deps/zutil.Po
       rm -f libzd_in_slim.a
       ar cru libzd_in_slim.a deflate.o infblock.o infcodes.o inffast.o 
       inflate.o inftrees.o infutil.o adler32.o trees.o zd_mem.o zdelta.o zu     til.o
       ranlib libzd_in_slim.a
       make[2]: Leaving directory '/cygdrive/c/Users/alimjan/Documents/fast-hlground/slim-2.2.7/third_party/zdelta-2.1'
       make[2]: Entering directory '/cygdrive/c/Users/alimjan/Documents/fast-hlground/slim-2.2.7/third_party'
      make[2]: Nothing to be done for 'all-am'.
      make[2]: Leaving directory '/cygdrive/c/Users/alimjan/Documents/fast-hlground/slim-2.2.7/third_party'
      make[1]: Leaving directory '/cygdrive/c/Users/alimjan/Documents/fast-hlground/slim-2.2.7/third_party'
      Making all in src
      make[1]: Entering directory '/cygdrive/c/Users/alimjan/Documents/fast-hlground/slim-2.2.7/src'
      /bin/sh ./genconfig
      ./genconfig: line 2: $'\r': command not found
      ./genconfig: line 8: $'\r': command not found
      ./genconfig: line 10: $'\r': command not found
      ./genconfig: line 13: $'\r': command not found
      ./genconfig: line 16: $'\r': command not found
      ./genconfig: line 19: $'\r': command not found
      ./genconfig: line 20: $'cat\r': command not found
      ./genconfig: line 21: $'cat\r': command not found
      ./genconfig: line 22: $'\r': command not found
      ./genconfig: line 61: $'\r': command not found
      ./genconfig: line 62: $'\r': command not found
      ./genconfig: line 86: $'\r': command not found
      ./genconfig: line 87: $'\r': command not found
      ./genconfig: line 88: $'\r': command not found
      make[1]: *** [Makefile:1558: arch.h] Error 127
       make[1]: Leaving directory '/cygdrive/c/Users/alimjan/Documents/fast-hlground/slim-2.2.7/src'
       make: *** [Makefile:425: all-recursive] Error 1

现在,我无法在没有调试的情况下构建它。 我怎样才能解决这个问题? 请帮忙

2 个答案:

答案 0 :(得分:4)

genconfig是一个shell脚本,用DOS行结尾编写。在运行脚本时,此行结尾会混淆/bin/sh shell。您应该使用dos2unix转换为unix行结尾。

答案 1 :(得分:0)

使用记事本,记事本++(已测试)等编辑器在Windows中编写脚本时,其行尾(EOL)转换问题。

Notepad ++有一个转换END OF LINE CONVERSION(EOL)的选项。怎么做:转到编辑> EOL转换>选择Unix / OSX

在这里,保存脚本文件并运行它。它会起作用。