arm交叉编译opencv 3.4.12 , log4cpp , cJSON

终端输入以下命令

cmake-gui

弹出以下界面 :

说明:

Where is the source code对应opencv的文件夹,

Where to build the binaries对应opencv存放编译好的配置文件等信息的文件夹(比如刚创建的build文件夹)

 

--------------------------------------------------------------------------------------------

点击Configure,弹出编译方式选择对话框

选择第四项,交叉编译

做如下配置

 

Operating System 输入Linux

Processor 输入 arm 

C和C++填写自己的交叉编译器

Target Root填写编译器的lib

---------------------

海思平台如下配置:

 

Operation System --- arm-himix200-linux-gcc

gcc ----/opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-gcc

g++ ----/opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-g++

Target Root ---/opt/hisi-linux/x86-arm/arm-himix200-linux/bin

 

-----

点击Finish

-----

海思:

勾选Advanced

配置:CMAKE_EXE_LINKER_FLAGS:-lpthread -lrt -ldl

--------------

Search搜索BUILD_ZLIB,勾选上

Search搜搜BUILD_PNG,勾选上

 

同理,还有 TBB, TIFF, JPEG

 

==============================================

Search搜索Build_open 只留下这么几个模块

 

Search输入install,设置下install路径CMAKE_INSTALL_PREFIX:

 

Search搜 CMAKE_BUILD_TYPE,改成Release

Search搜build_sh,编译静态库:

点击Configure

点击Generate

进入build目录,执行编译

make -j8

make install

 

=============================================================

 

交叉编译: log4cpp

下载地址:https://github.com/orocos-toolchain/log4cpp/releases

编译:

./configure CC=/XXXX/bin/arm-linux-gnueabihf-gcc CXX=/XXXX/bin/arm-linux-gnueabihf-g++ --host=arm-linux --prefix=/abc/def --with-pthreads

 

==============================================================

 

交叉编译:  cJSON

静态库
gcc -c cJSON.c 
ar rcs libcjson.a cJSON.o


动态库
gcc -c -o cJSON.o -fPIC cJSON.c
gcc -shared -o libcjson.so cJSON.o
或直接连写:
gcc -shared -fPIC -o libcjson.so cJSON.c

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值