我正在尝试使用Yocto / Openembedded编译一个简单的PJSIP程序。我有这个错误:
fatal error: pjsua-lib/pjsua.h: No such file or directory
这是我的Makefile:
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
。同样的问题
答案 0 :(得分:2)
你要链接主机库,除非你正在构建一个本机包(你不是这样),否则这些主机库真的不是正确的。
你需要为pjsip制作一个配方来构建和安装它,然后这个配方应该依赖它。
答案 1 :(得分:0)
确保存在/usr/include/pjsua-lib/pjsua.h文件。
# INC=-I/usr/include/pjsua-lib # not ok
INC=-I/usr/include