[英]Using 32 bit .a library file in 64 bit linux machine
我正在尝试在64位计算机上使用32位.a文件。 我使用gcc -m32选项编译了源代码。 它给出了以下错误
gcc -m32 *.c -Llib -lquanser_communications -Iinclude -o prg.o`In file included from /usr/include/wchar.h:27:0,
from include/quanser_types.h:16,
from include/quanser_communications.h:16,
from include/quanser_stream.h:11,
from stream_client.c:3:/usr/include/features.h:374:25:
fatal error: sys/cdefs.h: No such file or directory
搜索之后,我找到了这个线程并安装了libx32gcc-4.8-dev和libc6-dev-i386软件包。
安装这些软件包并运行编译后,出现以下错误
gcc -m32 *.c -Llib -lquanser_communications -Iinclude -o prg.o
lib/libquanser_communications.a: file not recognized: File truncated
我该如何解决这个问题? 谢谢。
您可能会收到此错误,因为您的libquanser_communications是64位而不是32位。 您不能针对64位代码编译32位。
如果您自己编译libqunaser,请使用-m32标志进行编译(递归,直到完成所有依赖项为止)。
如果不是,请获取它的32位版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.