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

时间:2010-07-16 08:10:20

标签: windows gcc compilation

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

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

不同之处在于我正在使用msys 1.10并尝试从SVN构建gcc trunk。源代码树在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

2 个答案:

答案 0 :(得分:0)

Scott Meyers的文章已经过时,预装的gcc4二进制文件最终可以在Windows上使用。只需访问MinGW网站即可下载。

答案 1 :(得分:0)

我解决了这个问题。

在此处查看:Problem compiling freetype2 with MinGW/MSYS

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

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

相关问题