在编译前我已经做好了D-bus1.8.10,glib2.28.6,bluez-libs-3.36,bluez-utils-3.36的编译,并且已经设置好了环境,如果遇到明明已经成功了编译,却找不到编译后的库文件,可以参考http://blog.csdn.net/wang_shuai_ww/article/details/41720841。

我这里在完成上面说的之后,编译bluez-5.25遇到的问题如下:

首先是找不到libudev。

这个错误使用命令sudo apt-get install libudev-dev。如果使用的是Ubuntu的官方源,可能会报错,具体的解决方法,参考http://blog.csdn.net/wang_shuai_ww/article/details/41720605。

安装完之后,再次配置出现error: libical is required的错误,找不到 libical 。

解决方法同上sudo apt-get install libical-dev,如果参考http://blog.csdn.net/wang_shuai_ww/article/details/41720605已经修改了源,那么这一步是没有问题的。

然后又报错error: readline header files are required,这个可以参考http://blog.chinaunix.net/uid-20196318-id-3930371.html或者http://ubuntuforums.org/showthread.php?t=1670531,实际上使用sudo apt-get install libreadline-dev命令即可。如果使用的arm编译器没有改头文件,即使安装了,可能仍然解决不了,这时只需要把宿主机的/usr/includereadline整个目录拷贝到自己的arm-linux的编译器的usr/include目录下即可。不同的arm编译器可能路径不同,我这里的路径是/usr/local/arm/arm-cortex_a9-eabi-4.7/arm-cortex_a9-linux-gnueabi/sysroot/usr/include/。

然后还有错误checking systemd system unit dir... configure: error: systemd system unit directory is required,错误真多,烦死人。

该错误可以参考http://askubuntu.com/questions/343663/ubuntu-13-04-and-bluez-5-8-configure-error-systemd-system-unit-directory-is-re,具体的就是加上编译选项--sysconfdir=/etc --localstatedir=/var --enable-experimental --with-systemdsystemunitdir=/lib/systemd/system --with-systemduserunitdir=/usr/lib/systemd

最后的配置命令是:./configure --prefix=/wsh_space/my_install/usr/lib/lib --host=arm --build=arm-cortex_a9-linux-gnueabi CC=arm-cortex_a9-linux-gnueabi-gcc --sysconfdir=/etc --localstatedir=/var --enable-experimental --with-systemdsystemunitdir=/lib/systemd/system --with-systemduserunitdir=/usr/lib/systemd

一定要注意CC后面的编译器,千万不要加上D-bus1.8.10,glib2.28.6,bluez-libs-3.36,bluez-utils-3.36这些库的安装路径,好像是新版的bluez-5.25集成了一些东西,不再需要依赖bluez-libs-3.36提供的头文件,加上的话会报错的(sdp_lib.h的481行与sdpd-request.c的225行,函数调用参数不匹配)。不添加安装路径就使用默认的路径,也就是在bluez-5.25/lib/bluetooth目录下的sdp_lib.h(实际上是bluez-5.25/lib/目录下的sdp_lib.h),这个是正确的函数声明。

重新配置,终于大功告成。

附上配置的整个流程:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking for style of include used by make... GNU
checking for arm-gcc... arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include accepts -g... yes
checking for arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include option to accept ISO C89... none needed
checking dependency style of arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include... gcc3
checking how to run the C preprocessor... arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for arm-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for C/C++ restrict keyword... __restrict
checking for arm-gcc... (cached) arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include accepts -g... (cached) yes
checking for arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include option to accept ISO C89... (cached) none needed
checking dependency style of arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include... (cached) gcc3
checking whether arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include and cc understand -c and -o together... yes
checking whether arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include accepts -fPIE... yes
checking build system type... arm-cortex_a9-linux-gnueabi
checking host system type... arm-unknown-none
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include... /usr/local/arm/arm-cortex_a9-eabi-4.7/arm-cortex_a9-linux-gnueabi/bin/ld
checking if the linker (/usr/local/arm/arm-cortex_a9-eabi-4.7/arm-cortex_a9-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-dumpbin... no
checking for arm-link... no
checking for dumpbin... no
checking for link... link -dump
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert arm-cortex_a9-linux-gnueabi file names to arm-unknown-none format... func_convert_file_noop
checking how to convert arm-cortex_a9-linux-gnueabi file names to toolchain format... func_convert_file_noop
checking for /usr/local/arm/arm-cortex_a9-eabi-4.7/arm-cortex_a9-linux-gnueabi/bin/ld option to reload object files... -r
checking for arm-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... unknown
checking for arm-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for arm-strip... strip
checking for arm-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include object... ok
checking for sysroot... no
checking for arm-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include supports -fno-rtti -fno-exceptions... no
checking for arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include option to produce PIC... -fPIC -DPIC
checking if arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include PIC flag -fPIC -DPIC works... yes
checking if arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include static flag -static works... yes
checking if arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include supports -c -o file.o... yes
checking if arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include supports -c -o file.o... (cached) yes
checking whether the arm-cortex_a9-linux-gnueabi-gcc -L/wsh_space/my_install/usr/lib/lib -I/wsh_space/my_install/usr/lib/include linker (/usr/local/arm/arm-cortex_a9-eabi-4.7/arm-cortex_a9-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for signalfd... yes
checking for clock_gettime in -lrt... yes
checking for pthread_create in -lpthread... yes
checking for dlopen in -ldl... yes
checking for GLIB... yes
checking for DBUS... yes
checking D-Bus configuration directory... /wsh_space/my_install/usr/lib/etc
checking D-Bus system bus services dir... /wsh_space/my_install/usr/lib/share/dbus-1/system-services
checking D-Bus session bus services dir... /wsh_space/my_install/usr/lib/share/dbus-1/services
checking for UDEV... yes
checking for udev_hwdb_new in -ludev... no
checking udev directory... /lib/udev
checking for ICAL... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/bluetoothd.8
config.status: creating lib/bluez.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

上面配置虽然没问题了,可是编译还是有问题的,如下:

1.tools/hid2hci.c:43:21: fatal error: libudev.h: 没有那个文件或目录

obexd/plugins/phonebook-dummy.c:40:26: fatal error: libical/ical.h: 没有那个文件或目录

解决方法是:没有了。

重来,前面都废了,编译不过去。

编译bluez-5.25 遇到的错误及解决方法相关推荐

  1. 编译Qt“NMAKE:fatal error U1077”错误的解决方法

    编译Qt"NMAKE:fatal error U1077"错误的解决方法 分类: 错误与解决方法 2013-03-18 20:17 1775人阅读 评论(0) 收藏 举报 Qtfa ...

  2. linux安装源文件出现错误,编译安装源码时出现错误的解决方法

    由于软件更新速度比较快,所以我们经常需要自己动手去编译安装一个软件,但是编译安装时难免不出现错误,像LAMP,LNMP在好多平台我都是手动编译的,也出现过不少错误,以下总结编译安装出现错误时的解决方法 ...

  3. Keil MDK5 编译报Undefined symbol __builtin_ffs 的错误的解决方法

    问题描述 __builtin_ffs 的作用,就是求一个32位数值中,从低位开始的1出现的位置,这算是一个内置的函数,所以直接使用,计算会比较的快. RT-Thread 内核代码中,使用这个 函数,作 ...

  4. Android 编译报XML declaration not well-formed错误的解决方法

    项目上一秒还运行得好好的,下一秒编译却突然不成功,报如下错误 FAILURE: Build failed with an exception.* What went wrong: Execution ...

  5. 关于msbuild 编译.net 4.5新语法错误的解决方法

    .net4.5以前msbuild 是在%windir%/Microsoft.NET/FrameworkXX/vXX目录下,如:C:\Windows\Microsoft.NET\Framework64\ ...

  6. uClinux 内核编译常见错误及解决方法(zt)

    uClinux 内核编译常见错误及解决方法(uClinux kernel compile Troubleshooting) uClinux kernel compile Troubleshooting ...

  7. 18.16 gcc-3.4.5编译错误及解决方法集锦

    18.16 gcc-3.4.5编译错误及解决方法集锦 参考文章: (1)18.16 gcc-3.4.5编译错误及解决方法集锦 (2)https://www.cnblogs.com/baixu/p/10 ...

  8. Android 源码编译及常见错误及解决方法

    Android 源码编译及常见错误及解决方法 参考文章: (1)Android 源码编译及常见错误及解决方法 (2)https://www.cnblogs.com/kyyblabla/p/360393 ...

  9. 编译android源码遇到错误及其解决方法

    升级ubuntu的14.04后,android的源码又编译错误了,一下是错误说明赫解决方法: 1.make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_ ...

最新文章

  1. 无限的Bash历史[关闭]
  2. 相声演员侯耀文突发疾病去世享年59岁 深切怀念
  3. 我的第一个微信好友分析
  4. Leetcode 534打劫房屋II python
  5. 成都两年JAVA工程师_成都Java工程师学习路线
  6. mysql数据库表的导入导出
  7. Netty 的 FastThreadLocal 到底快在哪里
  8. cl_salv_table
  9. Button.Text属性换行问题(Button.Bounds自动换行)
  10. 免费的进销存系统哪个好一些?
  11. 假设有一个英文文本文件,编写程序读取其内容,并将其中的大写字母变为小写字母,小写字母变为大写字母。...
  12. 电脑插入U盘后里面的文件变成快捷方式解决办法
  13. Error parsing INI config file: the argument ('true??') for option 'logappend' is invalid.
  14. js根据出生日期计算年龄及根据年龄计算出生日期
  15. Google Chrome谷歌浏览器去掉右上角更新提示图标
  16. JWT、JWS与JWE
  17. java1.8 xp_最新版Java8怎么在XP系统电脑上安装?
  18. 手把手教你搭建gitlab服务器
  19. 汽车仪表盘CAN总线实现
  20. 为什么Flutter已成为2020年开发移动应用程序的最佳选择?

热门文章

  1. 探测器反向偏压_科学网—《涨知识啦22》---MSM型光电探测器 - 寇建权的博文
  2. MySQL 磁盘空间不够用 方案_Mysql数据磁盘不足,不停机扩容方案
  3. okhttp连接池_OkHttp配置HTTPS访问+服务器部署
  4. html 属于mvvm框架,mvvm模式和mvc的区别是什么?
  5. comsol固体传热_【 COMSOL 知识库】如何解决 COMSOL 软件“内存不足” 的问题
  6. linux批量安装 五大开源软件挨个看,51CTO_Linux运维和管理:自动化监测.pdf
  7. 安装mysql冲突_Linux下安装mysql版本冲突问题解决
  8. pdf to word android,Scanned PDF to Word
  9. 西门子标准报文1常用_基于Snap7使用C#编程访问西门子PLC系列教程(2)-S7协议
  10. spark-sql执行时报错: