Compiling a c program on a 64 bit machine with a 32 bit binary

十年热恋 提交于 2019-12-10 00:36:11

问题


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

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?


回答1:


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

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

Have you installed cygwin32 ?



来源:https://stackoverflow.com/questions/23912004/compiling-a-c-program-on-a-64-bit-machine-with-a-32-bit-binary

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!