使用Cygwin G ++ Windows 64bit错误编译带有-m32的C ++

时间:2017-12-07 20:54:45

标签: mingw mingw32

我正在尝试使用cygwin g ++使用-m32编译我的c ++程序,但是当我尝试这样做时出现错误。

从我读到的关于这个问题的内容来看,我需要从cygwin包管理器下载一个包,它允许-m32工作,但我不确定它是哪个包。我读到的另一篇文章说我必须从软件包管理器安装gcc-multilibg++-multilib,但这些软件包不在可用软件包的选择中。

/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc_s.dll.a when     searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc_s.dll.a when     searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc_s.dll.a when     searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc_s.dll.a when     searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../libcygwin.a     when searching for -lcygwin
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../libcygwin.a     when searching for -lcygwin
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../libcygwin.a     when searching for -lcygwin
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -lcygwin
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -ladvapi32
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -lshell32
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -luser32
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -lkernel32
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc_s.dll.a when     searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc_s.dll.a when     searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc_s.dll.a when     searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc_s.dll.a when     searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -lgcc_s
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0//libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/libgcc.a when     searching for -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:     cannot find -lgcc
collect2: error: ld returned 1 exit status

感谢。

1 个答案:

答案 0 :(得分:2)

正如您所说,cygwin不提供{gcc|g++}-mulitlib包 包经理。

要构建32位C ++目标,请安装包mingw64-i686-gcc-g++ 是用于32位目标的mingw64交叉编译器。然后建立与 编译器/usr/bin/i686-w64-mingw32-g++-m32无需= simple_form_for @website, method: :put do |f| = f.input :ad_tag_ids, collection: @website.ad_tags.google.map { |a| [a.name, a.attached ? a.id : nil] }, as: :select, input_html: { multiple: true, size: 30 } = f.button :submit, class: 'btn-primary' 选项。