[英]Compiling a c program on a 64 bit machine with a 32 bit binary
I am currently trying to use the libssh.dll library to implement ac program that shall connect to remote computers.I am using gcc to compile the program. 我目前正在尝试使用libssh.dll库来实现将连接到远程计算机的ac程序。我正在使用gcc来编译该程序。 When compiling this program, I received this error:
编译该程序时,出现以下错误:
i386 architecture of input file 'libssh/bin/libssh.ddl' is incompatible with i386:x86-64 output
I tried compiling the program with the -m32 flag, but then i receive these errors: 我尝试使用-m32标志编译程序,但随后收到以下错误消息:
/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? 任何想法如何解决此问题?
You need to install the 32-bit version of the C library. 您需要安装32位版本的C库。
The 32-bit libraries are required if you want to be able to compile and link with the -m32
option. 如果要能够编译和链接
-m32
选项,则需要32位库。
Have you installed cygwin32
? 您安装了
cygwin32
吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.