编译openwrt时报错build_dir/hostpkg/libubox-2018-07-25-c83a84af/blobmsg_json.c:21:19: fatal error: json.h:

答:

一. 详细日志:

build_dir/hostpkg/libubox-2018-07-25-c83a84af/blobmsg_json.c:21:19: fatal error: json.h: No such file or directory

CMakeFiles/blobmsg_json-static.dir/build.make:62: recipe for target 'CMakeFiles/blobmsg_json-static.dir/blobmsg_json.c.o' failed
make[6]: *** [CMakeFiles/blobmsg_json-static.dir/blobmsg_json.c.o] Error 1

二. 通过查看生成的文件CMakeFiles/blobmsg_json-static.dir/flags.make,发现其中生成的一个C_INCLUDES变量指定了json的头文件路径为:

staging_dir/hostpkg/include,因此执行以下指令即可解决此问题:

cp build_dir/target-aarch64_generic_musl/json-c-0.12.1/ipkg-install/usr/include/json-c staging_dir/hostpkg/include/ -r

上一篇:CMakeFiles/Makefile2:838: recipe for target ‘grid_path_searcher/CMakeFiles/random_complex.dir/all‘ f


下一篇:wenti