首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:编译dahdi-tools fro android时找不到-lpthread

错误:编译dahdi-tools fro android时找不到-lpthread
EN

Stack Overflow用户
提问于 2015-12-25 16:24:57
回答 1查看 769关注 0票数 0

我正在尝试编译适用于android的dahdi-linux-complete-2.10.2+2.10.2中的工具。

我已经使用下面的android_configure.sh文件完成了./configure。它是基于https://gist.github.com/nddrylliog/4688209

代码语言:javascript
复制
 #!/bin/sh
 export ANDROID_SDK=/home/aks/android4.2
 # I put all my dev stuff in herej
 export DEV_PREFIX=${ANDROID_SDK}/development/

# Don't forget to adjust this to your NDK path
#export ANDROID_NDK=${DEV_PREFIX}/ndk/

export CROSS_COMPILE=arm-linux-androideabi

# I chose the gcc-4.7 toolchain - works fine for me##!
export ANDROID_PREFIX=${ANDROID_SDK}/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6

# Apparently android-8 works fine, there are other versions, look them up
export SYSROOT=${ANDROID_SDK}/prebuilts/ndk/8/platforms/android-9/arch-arm

#export CROSS_PATH=/home/androida20/a20_rbox/lichee/out/android/common/buildroot/external-toolchain/arm-linux-gnueabi/bin

# Non-exhaustive lists of compiler + binutils
# Depending on what you compile, you might need more binutils than that
export CPP=${CROSS_PATH}-cpp
export AR=${CROSS_PATH}-ar
export AS=${CROSS_PATH}-as
export NM=${CROSS_PATH}-nm
export CC=${CROSS_PATH}-gcc
export CXX=${CROSS_PATH}-g++
export LD=${CROSS_PATH}-ld
export RANLIB=${CROSS_PATH}-ranlib

# This is just an empty directory where I want the built objects to be installed
export PREFIX=${HOME}/android-prefix

# Don't mix up .pc files from your host and build target
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig

# You can clone the full Android sources to get bionic if you want.. I didn't
# want to so I just got linker.h from here: http://gitorious.org/0xdroid/bionic
# Note that this was only required to build boehm-gc with dynamic linking support.
export CFLAGS="${CFLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include -I${ANDROID_SDK}/bionic"
export CPPFLAGS="${CFLAGS}"
export LDFLAGS="${LDFLAGS} --sysroot=${SYSROOT} -L${SYSROOT}/usr/lib -L${ANDROID_PREFIX}/lib" 
./configure --host=${CROSS_COMPILE} --with-sysroot=${SYSROOT} --prefix=${PREFIX} --with-dahdi=../linux "$@"

为了编译,我运行了以下命令

代码语言:javascript
复制
./android_configure.sh
make

make显示以下错误

代码语言:javascript
复制
error: cannot find -lpthread

下面是make的最后一条错误消息

代码语言:javascript
复制
/home/androida20/a20_rbox/android4.2/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc --sysroot=/home/androida20/a20_rbox/android4.2/prebuilts/ndk/8/platforms/android-9/arch-arm -L/home/androida20/a20_rbox/android4.2/prebuilts/ndk/8/platforms/android-9/arch-arm/usr/lib -L/home/androida20/a20_rbox/android4.2/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/lib dahdi_cfg.o version.o libtonezone.a -lm -lpthread -o dahdi_cfg
/home/androida20/a20_rbox/android4.2/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lpthread
collect2: ld returned 1 exit status
make: *** [dahdi_cfg] Error 1

在这方面的任何帮助都是值得感谢的。提前感谢

EN

回答 1

Stack Overflow用户

发布于 2015-12-29 19:18:08

在android中它使用了bionic,它有自己的pthread实现,所以在从makefile中删除-lpthread之后,它就能够编译了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34461246

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档