簡體   English   中英

在64位Linux計算機上使用32位.a庫文件

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM