[bitbake-devel] need help to write a recipe to link a static library to my application

Khem Raj raj.khem at gmail.com
Sat Jul 22 00:25:55 UTC 2017


On Fri, Jul 21, 2017 at 6:43 PM Andre McCurdy <armccurdy at gmail.com> wrote:

> On Fri, Jul 21, 2017 at 12:11 PM, Viditha Murahari
> <viditha at mpconsultants.org> wrote:
> > I'm new to yocto and bitbake and I'm building a voip application for a
> > custom imx6 board. I want to use  pjsip libraries to build my
> application, I
> > have compiled pjsip in my yocto build and generated pjsip libraries ( all
> > pjsip libraries r static). I'm having issues building a recipe for my
> > application that calls the pjsip functions. Below is how my recipe looks
> >
> >
> > Filename: rttapp.bb
> >
> > DESCRIPTION = "Simple voip application"
> > SECTION = "examples"
> > LICENSE = "MIT"
> > LIC_FILES_CHKSUM
> > ="file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
> > PR = "r1"
> >
> > SRC_URI += "file://rttapp.c"
> > SRC_URI += "file://include"
> > SRC_URI += "file://lib"
> >
> > S = "${WORKDIR}"
> >
> > CFLAGS_prepend += "-I${WORKDIR}/include -DPJ_AUTOCONF=1
> -DPJ_IS_BIG_ENDIAN=0
> > -DPJ_IS_LITTLE_ENDIAN=1"
> > LDFLAGS_append += "-L${WORKDIR}/lib -lpjsua2-arm-poky-linux-gnueabi
> -lstdc++
> > -lpjsua-arm-poky-linux-gnueabi -lm -lrt -lpthread -lasound"
> >
> > do_compile() {
> > ${CC} ${CFLAGS} ${LDFLAGS} rttapp.c -o rttapp
>
> Try splitting this into two commands. First compile rttapp.c to
> rttapp.o and then link the final application as a second step. When
> linking the application, ensure that rttapp.o is listed on the command
> line before the libraries which provide the symbols it requires.
>
> > }
> >
> >
> > When i do bitbake rttapp, the error i see is as below
> >
> >
> > Log data follows:
> > DEBUG: Executing shell function do_compile
> > /tmp/cc6nn4Dp.o: In function `main':
> > /usr/src/debug/rttapp/1.0-r1/rttapp.c:159: undefined reference to
> > `pjsua_create'
> > collect2: error: ld returned 1 exit status
> > WARNING: exit code 1 from a shell command.
> >
> >
> > Please advise


You are not having the said libraries in your workdir ensure that either
you have them via fetcher or via depends

>
> >
> > --
> > _______________________________________________
> > bitbake-devel mailing list
> > bitbake-devel at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/bitbake-devel
> >
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20170722/845e7717/attachment-0002.html>


More information about the bitbake-devel mailing list