.h:没有这样的文件或目录YOCTO/Openembedded

.h: No such file or directory YOCTO/Openembedded

本文关键字:YOCTO Openembedded 文件      更新时间:2023-10-16

我正在尝试使用Yocto/Openembedded编译一个简单的PJSIP程序。我有这个错误:
fatal error: pjsua-lib/pjsua.h: No such file or directory
这是我的制作文件:

all: simple_pjsua
simple_pjsua: simple_pjsua.c
    $(CC) -o $@ $< `pkg-config --cflags --libs libpjproject`
clean:
    rm -f simple_pjsua.o simple_pjsua

这是我的simplepjsua_2.6.bb:

DESCRIPTION = "Open source SIP stack and media stack for presence, im/instant 
               messaging, and multimedia communication"
SECTION = "libs"
HOMEPAGE = "http://www.pjsip.org/"
# there are various 3rd party sources which may or may not be part of the
# build, there license term vary or are not explicitely specified.
LICENSE = "CLOSED"
PR = "r0"
SRC_URI = "file://simple_pjsua.c 
           file://Makefile 
           file://README.txt"
S = "${WORKDIR}/"
do_compile() {
    cd ${S}
    #to prevent libpjproject.PC not found error
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    oe_runmake
}
do_install() {
        install -m 0755 -d ${D}${bindir} ${D}${docdir}/simple_pjsua
        install -m 0755 ${S}/simple_pjsua ${D}${bindir}
        install -m 0755 ${WORKDIR}/README.txt ${D}${docdir}/simple_pjsua
}

我尝试在Makefile中添加INC=-I/usr/include/pjsua-lib/但没有任何变化。如果我想在我的计算机上编译它make它就可以工作了。

我能做什么?

编辑:
我尝试在 bb 文件的 do_compile(( 中添加export LD_LIBRARY_PATH=/usr/include。同样的问题

你正在链接到主机库,这真的不是正确的做法,除非你正在构建一个原生包(你不是(。

您需要为 pjsip 制作一个配方来构建和安装它,然后这个配方应该依赖于它。

确保/usr/include/pjsua-lib/pjsua.h 文件存在。

# INC=-I/usr/include/pjsua-lib # not ok
INC=-I/usr/include