【问题标题】:/usr/lib/libgmodule-2.0.so: could not read symbols: File in wrong format/usr/lib/libgmodule-2.0.so:无法读取符号:文件格式错误
【发布时间】:2015-08-27 11:10:00
【问题描述】:

我尝试从源代码交叉编译bluez-utils-3.36

主机(我构建代码的机器)

Processor: Intel(R) Xeon(R) CPU E5-2420 0 @ 1.90GHz
OS Version: Linux 2.6.32-44 generic

目标机:(编译文件应该运行的目标)

Processor: ARM926EJ-S rev 5 (v5l)
OS Version: Linux 2.6.35.3-571 

目标似乎有一个 ARM 处理器,所以我导航到 bluez-utils-3.36 并执行以下命令:

./configure \
--host=arm-linux \
BLUEZ_CFLAGS=-I/home/shortened_the_path/bluetooth/bluez-libs-3.36/include \
BLUEZ_LIBS="-L/home/shortened_the_path/bluetooth/bluez-libs-3.36/src/.libs -lbluetooth"

此运行成功。在这之后我执行make,并得到这个错误:

/usr/lib/libgmodule-2.0.so: could not read symbols: File in wrong format

  • 我的 libgmodule-2.0.so 文件是否损坏?

有谁知道我怎么可能解决这个问题?

【问题讨论】:

    标签: compilation compiler-errors cross-compiling compiler-warnings


    【解决方案1】:

    您正在为 arm 进行编译,但您尝试链接的 libgmodule 库是为您的 PC 架构构建的。所以你必须交叉编译 glib,它是 bluez 的一个依赖项。

    看看这个链接,它详细解释了如何交叉编译 bluez

    http://wiki.beyondlogic.org/index.php?title=Cross_Compiling_BlueZ_Bluetooth_tools_for_ARM

    【讨论】:

    • 在我交叉编译后是否还必须使用make install 安装glib?
    • 告诉我你需要什么。 make 也参与交叉编译。那么你把它和make一起使用是什么意思
    • 你可以像其他包一样交叉编译bluez-utils
    • 那你没有仔细看。 Bluez 只是一个软件包。
    • 好的,我会列出你需要交叉编译的包 1)zlib 2)libffi 3)glib 4)expat 5)dbus 6)libical 7)ncurses 8)readline 9)bluez 然后不管你需要什么
    猜你喜欢
    • 2020-10-26
    • 2020-11-29
    • 2015-03-29
    • 2016-08-11
    • 1970-01-01
    • 2014-11-16
    • 2014-10-14
    • 1970-01-01
    • 2012-08-06
    相关资源
    最近更新 更多