在64位机器上编译C程序与32位二进制 [英] Compiling a c program on a 64 bit machine with a 32 bit binary

查看:1631
本文介绍了在64位机器上编译C程序与32位二进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用libssh.dll库来实现交流计划,将正在使用gcc编译程序连接到远程computers.I。当编译这个程序,我收到此错误:

I am currently trying to use the libssh.dll library to implement a c program that shall connect to remote computers.I am using gcc to compile the program. When compiling this program, I received this error:

i386 architecture of input file 'libssh/bin/libssh.ddl' is incompatible with i386:x86-64 output

我试图与-m32标志编译程序,但后来我收到这些错误:

I tried compiling the program with the -m32 flag, but then i receive these errors:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2//libgcc_s.dll.a when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2//libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../libcygwin.a when searching for -lcygwin
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/libgcc_s.dll.a when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2//libgcc.a when searching for -lgcc

任何想法如何解决这个问题?

Any ideas how to fix this issue?

推荐答案

您需要安装32位版本的C库。

You need to install the 32-bit version of the C library.

如果您希望能够编译并与 -m32 选项链接32位库是必需的。

The 32-bit libraries are required if you want to be able to compile and link with the -m32 option.

您已经安装了 cygwin32

这篇关于在64位机器上编译C程序与32位二进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆