linux下jsoncpp编译

折腾了一顿,我使用ubuntu16.04编译的jsoncpp,由于使用的芯片工程需要16.04,无法使用最新的ubuntu系统。

发现jsoncpp编译时,

CMake Error: Could not find CMAKE_ROOT !!! CMake has most likely not been installed correctly. Modules directory not found in /usr/local/share/cmake-3.5 cmake version 3.5.2 CMake suite maintained and supported by Kitware (kitware.com/cmake). 

workspace/tools/jsoncpp/build/debug#

 DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_INCLUDEDIR=include/jsoncpp -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ../.. CMake Error: Could not find CMAKE_ROOT !!! CMake has most likely not been installed correctly. Modules directory not found in /usr/local/share/cmake-3.5 CMake Error: Error executing cmake::LoadCache(). Aborting.

编译时出这个错的原因是由于cmake版本太低了,我把cmake版本升级到了。

cmake version 3.31.4 

可以cmake成功。

然后在交叉编译时,在CMakeLists.txt中把test配置为off,可以交叉编译成功了。 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值