折腾了一顿,我使用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,可以交叉编译成功了。