I wrote a recipe to compile a git repo in Yocto. The repository contains a Makefile to compile the code. The first time I was able to compile the code in Yocto, but when I added the jsoncpp library in my code, Yocto not able to compile it. It is showing some error like
test_1.cpp:5:10: fatal error: jsoncpp/json/json.h: No such file or directory
| 5 | #include <jsoncpp/json/json.h>
| | ^~~~~~~~~~~~~~~~~~~~~
Here is my recipe file. Please suggest me the change I need to done to compile the code.
yocto_test.bb
SUMMARY = "Hello World"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
DEPENDS = "jsoncpp"
SRCREV = "90052737ee51abca69a334a9208e2fec82d78c19"
SRC_URI = " \
git://github.com/arghyaBiswas05/yocto-test.git \
"
S = "${WORKDIR}/git/"
do_compile() {
oe_runmake all
}
# Install binary to final directory /usr/bin
do_install() {
install -d ${D}${bindir}
install -m 0755 ${S}test_file ${D}${bindir}
}
Here is my Makefile
all:
${CXX} test_1.cpp -o test_file $(shell pkg-config --cflags --libs jsoncpp)
install:
cp test_file /usr/bin
clean:
rm -rf test_file
Please suggest me the change.