未定义对'Atexit - Bluez编译的引用

undefined reference to `atexit - bluez compilation

本文关键字:Bluez 编译 引用 Atexit 未定义      更新时间:2023-10-16

当我尝试将bluez-4.101交叉编译为mipsel-linux目标时,我遇到了这个问题。

plugins/bluetoothd-hciops.o: In function `init_device':
hciops.c:(.text+0xadc0): undefined reference to `atexit'
hciops.c:(.text+0xadc8): undefined reference to `atexit'

以下是指定的编译器选项和链接器选项

-lstdc++
-L 具有 libstdc++.so 所在的
路径 -nostdlib 未指定

期待您的帮助。

添加

 #include <stdlib.h>

到文件。