【问题标题】:"backslash not last character on line" when compiling gcc on windows在 Windows 上编译 gcc 时“反斜杠不是最后一个字符”
【发布时间】:2010-07-16 08:10:20
【问题描述】:

我遵循本指南主要是为了在 Windows 上编译 gcc:

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

不同之处在于我使用的是 msys 1.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'    

我使用的命令行是这样的:

../configure --prefix=C:/rosbe/i586 --build=mingw32 --host=mingw32 --target=mingw32 --enable-languages=c,c++ --disable-win32-registry -- enable-sjlj-exceptions --enable-threads=win32 --enable-checking=release

【问题讨论】:

    标签: windows gcc compilation


    【解决方案1】:

    Scott Meyers 的文章已经过时,因为预构建的 gcc4 二进制文件终于可以在 Windows 上使用。只需前往MinGW 网站并下载它们。

    【讨论】:

    • GCC 4.6 未发布。无论如何,如果您只想拥有足够近的 GCC,那么 4.5 或 4.4 就足够了。另一方面,如果您的目标是专门在 MinGW 上构建 GCC 主干,那么我的回答没有用。
    【解决方案2】:

    我解决了这个问题。

    看这里:Problem compiling freetype2 with MinGW/MSYS

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

    事实证明,在安装 msys 之前,我的 $PATH 中出现了 MinGW 安装。我修复了它,现在它正在编译。

    【讨论】:

      猜你喜欢
      • 2020-10-13
      • 1970-01-01
      • 2021-12-07
      • 1970-01-01
      • 2022-01-23
      • 2015-07-29
      • 2014-12-04
      • 2017-10-10
      • 1970-01-01
      相关资源
      最近更新 更多