当前位置: 技术问答>linux和unix
请教arm-linux-gcc交叉编译的一个 错误
来源: 互联网 发布时间:2016-04-30
本文导语: 用arm-linux-gcc编译蓝牙程序时出现了如下错误,已经将libbluetooth这个库放到/usr/local/arm/3.4.1/arm-linux/lib中, In file included from /usr/include/sys/socket.h:36, from /usr/include/bluetooth/rfcomm.h:32, ...
用arm-linux-gcc编译蓝牙程序时出现了如下错误,已经将libbluetooth这个库放到/usr/local/arm/3.4.1/arm-linux/lib中,
In file included from /usr/include/sys/socket.h:36,
from /usr/include/bluetooth/rfcomm.h:32,
from obex.c:6:
/usr/include/bits/socket.h:92:1: warning: "PF_BLUETOOTH" redefined
In file included from obex.c:5:
/usr/include/bluetooth/bluetooth.h:41:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/socket.h:36,
from /usr/include/bluetooth/rfcomm.h:32,
from obex.c:6:
/usr/include/bits/socket.h:126:1: warning: "AF_BLUETOOTH" redefined
In file included from obex.c:5:
/usr/include/bluetooth/bluetooth.h:40:1: warning: this is the location of the previous definition
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__memcpy_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libopenobex.so: undefined reference to `__strcpy_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__vfprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libopenobex.so: undefined reference to `__fprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__strncat_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__vprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__snprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__vsnprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__printf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__sprintf_chk@GLIBC_2.3.4'
collect2: ld returned 1 exit status
请高手们指教怎么解决上面的错误,安装了libglib2.0-0_2.12.4-2_arm这个库也没有解决问题。
In file included from /usr/include/sys/socket.h:36,
from /usr/include/bluetooth/rfcomm.h:32,
from obex.c:6:
/usr/include/bits/socket.h:92:1: warning: "PF_BLUETOOTH" redefined
In file included from obex.c:5:
/usr/include/bluetooth/bluetooth.h:41:1: warning: this is the location of the previous definition
In file included from /usr/include/sys/socket.h:36,
from /usr/include/bluetooth/rfcomm.h:32,
from obex.c:6:
/usr/include/bits/socket.h:126:1: warning: "AF_BLUETOOTH" redefined
In file included from obex.c:5:
/usr/include/bluetooth/bluetooth.h:40:1: warning: this is the location of the previous definition
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__memcpy_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libopenobex.so: undefined reference to `__strcpy_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__vfprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libopenobex.so: undefined reference to `__fprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__strncat_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__vprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__snprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__vsnprintf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__printf_chk@GLIBC_2.3.4'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libbluetooth.so: undefined reference to `__sprintf_chk@GLIBC_2.3.4'
collect2: ld returned 1 exit status
请高手们指教怎么解决上面的错误,安装了libglib2.0-0_2.12.4-2_arm这个库也没有解决问题。
|
checkpoint:
1)libbluetooth 使用该交叉编译器编译的吗?
2)你的蓝牙程序跟这个libbluetooth是匹配的吗,也就是说使用这个库的API进行编程的吗?
BTW,不需要把libbluetooth库放到交叉编译器的 那个lib目录下,
对于库的链接,Linux有它的方法:
-L -lbluetooth
就是找此目录下的libbluetooth.so或者libbluetooth.a去链接
1)libbluetooth 使用该交叉编译器编译的吗?
2)你的蓝牙程序跟这个libbluetooth是匹配的吗,也就是说使用这个库的API进行编程的吗?
BTW,不需要把libbluetooth库放到交叉编译器的 那个lib目录下,
对于库的链接,Linux有它的方法:
-L -lbluetooth
就是找此目录下的libbluetooth.so或者libbluetooth.a去链接
|
库应该要用交叉编译工具编译
|
|
makefile
|
up 2 楼
遇到过一次
使用不同的编译器编译应用程序和库会造成这个问题
遇到过一次
使用不同的编译器编译应用程序和库会造成这个问题