Linux下用交叉编译器编译报错缺少Libc.so.6【求教】

Linux下用交叉编译器编译报错缺少Libc.so.6【求教】,第1张

#打开/etc/ld.so.conf,在最后一行添加/home/xassassin/armlinuxdev/bin/lib/

$sudo vim /etc/ld.so.conf

#执行此命令,然后再编译

$sudo ldconfig

环境配置

export PREFIX=/opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usrexport HOST=arm-none-linux-gnueabiexport BUILD=x86_64-unknown-linux-gnuexport LD_LIBRARY_PATH=$PREFIX/libexport PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig

libusb

Package: libusb-1.0.8.tar.bz2

a. 先声明上面的环境

b. ./configure --build=$BUILD --host=$HOST --prefix=$PREFIX --disable-static --disable-logc. maked.make install

libplist

Package: libplist-1.3.tar.bz2

这个需要用cmake编译,自己写一个toolchain.cmake 修改交叉编译变量

# this one is important

SET(CMAKE_SYSTEM_NAME Linux)#this one not so muchSET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler

SET(CMAKE_C_COMPILER /opt/arm-2009q1/bin/arm-none-linux-gnueabi-gcc)

SET(CMAKE_CXX_COMPILER /opt/arm-2009q1/bin/arm-none-linux-gnueabi-g++)

# where is the target environment

SET(CMAKE_FIND_ROOT_PATH /opt/dvrrdk/DVRRDK_04.00.00.03/ti_tools/cgt_a8/arago/linux-devkit/arm-arago-linux-gnueabi/usr)

# search for programs in the build host directories

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories

SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

然后在源码目录下 新建build文件夹

mkdir build

cd build

cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake ..

make DESTDIR=$PREFIX install

usbmuxd

Package: usbmuxd-1.0.4.tar.bz2

编译方法和libplist是一样的。现在通道已经打通。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8906903.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-22
下一篇 2023-04-22

发表评论

登录后才能评论

评论列表(0条)

保存