代码之家  ›  专栏  ›  技术社区  ›  Raindog

在Windows上编译gcc时,“反斜杠不是行上的最后一个字符”

  •  0
  • Raindog  · 技术社区  · 14 年前

    我主要遵循以下指南在Windows上编译gcc:

    http://www.aristeia.com/Misc/gcc4ForWindows.html

    区别在于,我使用的是MSYS1.10,并试图从SVN构建GCC主干。源代码树在Linux上编译良好,但是当我尝试在Windows上构建时,在运行配置脚本时会出现以下错误。

    <snip>
    checking where to find the target windmc... host tool
    checking whether to enable maintainer-specific portions of Makefiles... no
    checking whether -fkeep-inline-functions is supported... yes
    c:\MinGW\bin\sed.exe: -e expression #1, char 1: unknown command: `C'
    configure: creating ./config.status
    config.status: creating Makefile
    gawk: ./conf6456-2346/subs.awk:19: S["FLAGS_FOR_TARGET"]=" -L$$r/$(TARGET_SUBDIR
    )/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/ming
    w/include -isystem $$s/winsup/w32api/include -"\
    gawk: ./conf6456-2346/subs.awk:19:
    
                                               ^ backslash not last character on
     line
    c:\MinGW\bin\sed.exe: couldn't write 38 items to stdout: No error
    config.status: error: could not create Makefile
    c:\MinGW\bin\sed.exe: -e expression #1, char 1: unknown command: `C'    
    

    我使用的命令行是:

    /Opthase-前缀=C:/RoBe/I586-构建=明文32 -主机=明文32 -目标=明文32 -使能语言= C,C++ + DeababyWin32-注册表-启用SjLJ异常-启用线程= Win32 -启用检查=释放

    2 回复  |  直到 14 年前
        1
  •  0
  •   Laurynas Biveinis    14 年前

    ScottMeyers的文章过时了,因为预构建的GCC4二进制文件最终可以在Windows上使用。直接去 MinGW 网站并下载。

        2
  •  0
  •   Community CDub    7 年前

    我解决了这个问题。

    看这里: Problem compiling freetype2 with MinGW/MSYS

    我注意到我也有同样的错误。

    原来我有一个mingw的安装程序,在安装MSYS之前出现在我的$path中。我修正了这个,现在它正在编译。