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

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

问题描述

我目前正在尝试使用 libssh.dll 库来实现一个可以连接到远程计算机的 c 程序.我正在使用 gcc 来编译该程序.编译这个程序时,我收到这个错误:

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 位机器上用 32 位二进制编译 c 程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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