WWJ*_*WWJ 9 linux linux-device-driver
我在ubuntu12.04上用g ++/gcc编译它是"OK"但是我不能使用raspberry pi工具master交叉编译
toolsmaster
CC := /home/Desktop/Simple_Linux_Driver/tools-master/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-g++
GCC := /home/Desktop/Simple_Linux_Driver/tools-master/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-gcc
Run Code Online (Sandbox Code Playgroud)
我安装了以下项目:
-sudo apt-get install libusb-1.0-0-dev
-sudo apt-get install libudev-dev
Run Code Online (Sandbox Code Playgroud)
raspberry pi内核版本3.2.27(izzit我需要启用"如何"并重新重建)?
其作品!!!我需要在树莓派交叉工具大师中进行交叉编译和 cp .h .so 以下是我尝试的操作: 如果我错过了任何内容,请告诉我 谢谢^^ 下载 libusb 最新版本的 tar 文件。
版本1.0.8
$ TOOLCHAIN=/opt/FriendlyArm/toolchain/4.4.3/arm-none-linux-gnueabi
$ PATH=$PATH:$TOOLCHAIN/bin
$ CC='arm-none-linux-gnueabi-gcc -march=armv4t -mtune=arm920t'
$ CROSS_COMPILE=arm-none-linux-gnueabi-
$ export CC CROSS_COMPILE
$ tar xfv libusb-1.0.8.tar
$ cd libusb-1.0.8
$ ./configure --host arm-linux
$ make
$ cd libusb
$ cp libusb.h $TOOLCHAIN/arm-none-linux-gnueabi/include/
$ cp libusb.h $TOOLCHAIN/arm-none-linux-gnueabi/sysroot/include/
$ cp .libs/libusb-1.0.so $TOOLCHAIN/arm-none-linux-gnueabi/lib/
$ cp .libs/libusb-1.0.so $TOOLCHAIN/arm-none-linux-gnueabi/sysroot/lib/
Run Code Online (Sandbox Code Playgroud)
工具链已设置。对于编写程序:添加#include 以使用他的库。使用以下命令进行编译:
$arm-linux-g++ myprog.cpp -o myapp -lusb-1.0
Run Code Online (Sandbox Code Playgroud)
注意:不要错过“-lusb-1.0”