All of lore.kernel.org
 help / color / mirror / Atom feed
* need help to write a recipe to link a static library to my application
@ 2017-07-21 19:11 Viditha Murahari
  2017-07-21 19:15 ` kris duff
  2017-07-21 22:42 ` Andre McCurdy
  0 siblings, 2 replies; 8+ messages in thread
From: Viditha Murahari @ 2017-07-21 19:11 UTC (permalink / raw)
  To: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]

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
}




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

[-- Attachment #2: Type: text/html, Size: 1947 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: need help to write a recipe to link a static library to my application
  2017-07-21 19:11 need help to write a recipe to link a static library to my application Viditha Murahari
@ 2017-07-21 19:15 ` kris duff
  2017-07-21 22:42 ` Andre McCurdy
  1 sibling, 0 replies; 8+ messages in thread
From: kris duff @ 2017-07-21 19:15 UTC (permalink / raw)
  To: Viditha Murahari, bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 1896 bytes --]

Maybe it will not help you, but I would suggest you to use a complete development package.
I mean, you should use autotools or cmake to build your application locally, then package your source and inherit autotools or cmake. It will be easier for you to make things happend.
Hope this helps.
Kris 

    On Friday, July 21, 2017 3:11 PM, Viditha Murahari <viditha@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}



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 statusWARNING: exit code 1 from a shell command.

Please advise-- 
_______________________________________________
bitbake-devel mailing list
bitbake-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/bitbake-devel


   

[-- Attachment #2: Type: text/html, Size: 3762 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: need help to write a recipe to link a static library to my application
  2017-07-21 19:11 need help to write a recipe to link a static library to my application Viditha Murahari
  2017-07-21 19:15 ` kris duff
@ 2017-07-21 22:42 ` Andre McCurdy
  2017-07-22  0:25   ` Khem Raj
  1 sibling, 1 reply; 8+ messages in thread
From: Andre McCurdy @ 2017-07-21 22:42 UTC (permalink / raw)
  To: Viditha Murahari; +Cc: bitbake-devel

On Fri, Jul 21, 2017 at 12:11 PM, Viditha Murahari
<viditha@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
>
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: need help to write a recipe to link a static library to my application
  2017-07-21 22:42 ` Andre McCurdy
@ 2017-07-22  0:25   ` Khem Raj
  2017-07-24 15:40     ` Viditha Murahari
  2017-07-24 15:41     ` Viditha Murahari
  0 siblings, 2 replies; 8+ messages in thread
From: Khem Raj @ 2017-07-22  0:25 UTC (permalink / raw)
  To: Andre McCurdy, Viditha Murahari; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 2515 bytes --]

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

> On Fri, Jul 21, 2017 at 12:11 PM, Viditha Murahari
> <viditha@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@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/bitbake-devel
> >
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>

[-- Attachment #2: Type: text/html, Size: 3802 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: need help to write a recipe to link a static library to my application
  2017-07-22  0:25   ` Khem Raj
@ 2017-07-24 15:40     ` Viditha Murahari
  2017-07-24 15:41     ` Viditha Murahari
  1 sibling, 0 replies; 8+ messages in thread
From: Viditha Murahari @ 2017-07-24 15:40 UTC (permalink / raw)
  To: Khem Raj; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 4910 bytes --]

Hello Khem Raj,

I did a bitbake -e -c compile -f rttapp  , and this is how my  do_c0mpile
command looks

do_compile() {
        arm-poky-linux-gnueabi-gcc  -march=armv7ve -mfpu=neon
 -mfloat-abi=hard -mcpu=cortex-a7
--sysroot=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/sysroots/imx6ulevk
 -I/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/include
-DPJ_AUTOCONF=1 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -O2 -pipe -g
-feliminate-unused-debug-types
-fdebug-prefix-map=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1=/usr/src/debug/rttapp/1.0-r1
-fdebug-prefix-map=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/sysroots/x86_64-linux=
-fdebug-prefix-map=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/sysroots/imx6ulevk=
 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed
-L/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib
-lpjsua2-arm-poky-linux-gnueabi -lstdc++ -lpjsua-arm-poky-linux-gnueabi -lm
-lrt -lpthread -lasound rttapp.c -o rttapp
}

and i tried

ls
/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib

jeesu@MPCLinux:~/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib$
ls

libg7221codec-arm-poky-linux-gnueabi.a
libgsmcodec-arm-poky-linux-gnueabi.a
libilbccodec-arm-poky-linux-gnueabi.a
libpj-arm-poky-linux-gnueabi.a
libpjlib-util-arm-poky-linux-gnueabi.a
libpjmedia-arm-poky-linux-gnueabi.a
libpjmedia-audiodev-arm-poky-linux-gnueabi.a
libpjmedia-codec-arm-poky-linux-gnueabi.a
libpjmedia-videodev-arm-poky-linux-gnueabi.a
libpjnath-arm-poky-linux-gnueabi.a
libpjsip-arm-poky-linux-gnueabi.a
libpjsip-simple-arm-poky-linux-gnueabi.a
libpjsip-ua-arm-poky-linux-gnueabi.a
libpjsua2-arm-poky-linux-gnueabi.a
libpjsua-arm-poky-linux-gnueabi.a
libresample-arm-poky-linux-gnueabi.a
libspeex-arm-poky-linux-gnueabi.a
libsrtp-arm-poky-linux-gnueabi.a
pkgconfig

It looks like -L in my compile command is pointing to the right location
for my libraries. So im not clear what im missing. Please help.





On Fri, Jul 21, 2017 at 7:25 PM, Khem Raj <raj.khem@gmail.com> wrote:

>
> On Fri, Jul 21, 2017 at 6:43 PM Andre McCurdy <armccurdy@gmail.com> wrote:
>
>> On Fri, Jul 21, 2017 at 12:11 PM, Viditha Murahari
>> <viditha@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=0835ade698e0bcf8506ecda2f7b4f3
>> 02"
>> > 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@lists.openembedded.org
>> > http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>> >
>> --
>> _______________________________________________
>> bitbake-devel mailing list
>> bitbake-devel@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>>
>

[-- Attachment #2: Type: text/html, Size: 7078 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: need help to write a recipe to link a static library to my application
  2017-07-22  0:25   ` Khem Raj
  2017-07-24 15:40     ` Viditha Murahari
@ 2017-07-24 15:41     ` Viditha Murahari
  2017-07-25 15:46       ` Viditha Murahari
  1 sibling, 1 reply; 8+ messages in thread
From: Viditha Murahari @ 2017-07-24 15:41 UTC (permalink / raw)
  To: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 4913 bytes --]

Hello Khem Raj,

I did a bitbake -e -c compile -f rttapp  , and this is how my  do_c0mpile
command looks

do_compile() {
        arm-poky-linux-gnueabi-gcc  -march=armv7ve -mfpu=neon
 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/jeesu/viditha/
imx6ul-evk-audio/build/tmp/sysroots/imx6ulevk  -I/home/jeesu/viditha/imx6ul-
evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/include
-DPJ_AUTOCONF=1 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -O2 -pipe -g
-feliminate-unused-debug-types -fdebug-prefix-map=/home/
jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-
gnueabi/rttapp/1.0-r1=/usr/src/debug/rttapp/1.0-r1 -fdebug-prefix-map=/home/
jeesu/viditha/imx6ul-evk-audio/build/tmp/sysroots/x86_64-linux=
-fdebug-prefix-map=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/sysroots/imx6ulevk=
 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L/home/jeesu/viditha/imx6ul-
evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib
-lpjsua2-arm-poky-linux-gnueabi -lstdc++ -lpjsua-arm-poky-linux-gnueabi -lm
-lrt -lpthread -lasound rttapp.c -o rttapp
}

and i tried

ls /home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/
cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib

jeesu@MPCLinux:~/viditha/imx6ul-evk-audio/build/tmp/
work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib$ ls


libg7221codec-arm-poky-linux-gnueabi.a
libgsmcodec-arm-poky-linux-gnueabi.a
libilbccodec-arm-poky-linux-gnueabi.a
libpj-arm-poky-linux-gnueabi.a
libpjlib-util-arm-poky-linux-gnueabi.a
libpjmedia-arm-poky-linux-gnueabi.a
libpjmedia-audiodev-arm-poky-linux-gnueabi.a
libpjmedia-codec-arm-poky-linux-gnueabi.a
libpjmedia-videodev-arm-poky-linux-gnueabi.a
libpjnath-arm-poky-linux-gnueabi.a
libpjsip-arm-poky-linux-gnueabi.a
libpjsip-simple-arm-poky-linux-gnueabi.a
libpjsip-ua-arm-poky-linux-gnueabi.a
libpjsua2-arm-poky-linux-gnueabi.a
libpjsua-arm-poky-linux-gnueabi.a
libresample-arm-poky-linux-gnueabi.a
libspeex-arm-poky-linux-gnueabi.a
libsrtp-arm-poky-linux-gnueabi.a
pkgconfig

It looks like -L in my compile command is pointing to the right location
for my libraries. So im not clear what im missing. Please help.

On Fri, Jul 21, 2017 at 7:25 PM, Khem Raj <raj.khem@gmail.com> wrote:

>
> On Fri, Jul 21, 2017 at 6:43 PM Andre McCurdy <armccurdy@gmail.com> wrote:
>
>> On Fri, Jul 21, 2017 at 12:11 PM, Viditha Murahari
>> <viditha@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=0835ade698e0bcf8506ecda2f7b4f3
>> 02"
>> > 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@lists.openembedded.org
>> > http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>> >
>> --
>> _______________________________________________
>> bitbake-devel mailing list
>> bitbake-devel@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>>
>

[-- Attachment #2: Type: text/html, Size: 7576 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: need help to write a recipe to link a static library to my application
  2017-07-24 15:41     ` Viditha Murahari
@ 2017-07-25 15:46       ` Viditha Murahari
  2017-07-25 17:40         ` Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: Viditha Murahari @ 2017-07-25 15:46 UTC (permalink / raw)
  To: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 5378 bytes --]

Figured out the issue, it was actually a silly mistake

${CC} ${CFLAGS} ${LDFLAGS} rttapp.c -o rttapp
should have been
${CC} rttapp.c ${CFLAGS} ${LDFLAGS} -o rttapp

On Mon, Jul 24, 2017 at 10:41 AM, Viditha Murahari <
viditha@mpconsultants.org> wrote:

> Hello Khem Raj,
>
> I did a bitbake -e -c compile -f rttapp  , and this is how my  do_c0mpile
> command looks
>
> do_compile() {
>         arm-poky-linux-gnueabi-gcc  -march=armv7ve -mfpu=neon
>  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/jeesu/viditha/
> imx6ul-evk-audio/build/tmp/sysroots/imx6ulevk
>  -I/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/corte
> xa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/include -DPJ_AUTOCONF=1
> -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -O2 -pipe -g
> -feliminate-unused-debug-types -fdebug-prefix-map=/home/jeesu
> /viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-
> neon-poky-linux-gnueabi/rttapp/1.0-r1=/usr/src/debug/rttapp/1.0-r1
> -fdebug-prefix-map=/home/jeesu/viditha/imx6ul-evk-audio/
> build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/home/jeesu
> /viditha/imx6ul-evk-audio/build/tmp/sysroots/imx6ulevk=  -Wl,-O1
> -Wl,--hash-style=gnu -Wl,--as-needed -L/home/jeesu/viditha/imx6ul-e
> vk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib
> -lpjsua2-arm-poky-linux-gnueabi -lstdc++ -lpjsua-arm-poky-linux-gnueabi
> -lm -lrt -lpthread -lasound rttapp.c -o rttapp
> }
>
> and i tried
>
> ls /home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7
> hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib
>
> jeesu@MPCLinux:~/viditha/imx6ul-evk-audio/build/tmp/work/
> cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib$ ls
>
>
> libg7221codec-arm-poky-linux-gnueabi.a
> libgsmcodec-arm-poky-linux-gnueabi.a
> libilbccodec-arm-poky-linux-gnueabi.a
> libpj-arm-poky-linux-gnueabi.a
> libpjlib-util-arm-poky-linux-gnueabi.a
> libpjmedia-arm-poky-linux-gnueabi.a
> libpjmedia-audiodev-arm-poky-linux-gnueabi.a
> libpjmedia-codec-arm-poky-linux-gnueabi.a
> libpjmedia-videodev-arm-poky-linux-gnueabi.a
> libpjnath-arm-poky-linux-gnueabi.a
> libpjsip-arm-poky-linux-gnueabi.a
> libpjsip-simple-arm-poky-linux-gnueabi.a
> libpjsip-ua-arm-poky-linux-gnueabi.a
> libpjsua2-arm-poky-linux-gnueabi.a
> libpjsua-arm-poky-linux-gnueabi.a
> libresample-arm-poky-linux-gnueabi.a
> libspeex-arm-poky-linux-gnueabi.a
> libsrtp-arm-poky-linux-gnueabi.a
> pkgconfig
>
> It looks like -L in my compile command is pointing to the right location
> for my libraries. So im not clear what im missing. Please help.
>
> On Fri, Jul 21, 2017 at 7:25 PM, Khem Raj <raj.khem@gmail.com> wrote:
>
>>
>> On Fri, Jul 21, 2017 at 6:43 PM Andre McCurdy <armccurdy@gmail.com>
>> wrote:
>>
>>> On Fri, Jul 21, 2017 at 12:11 PM, Viditha Murahari
>>> <viditha@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=0835ade698e0bcf8506ec
>>> da2f7b4f302"
>>> > 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@lists.openembedded.org
>>> > http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>>> >
>>> --
>>> _______________________________________________
>>> bitbake-devel mailing list
>>> bitbake-devel@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 8280 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: need help to write a recipe to link a static library to my application
  2017-07-25 15:46       ` Viditha Murahari
@ 2017-07-25 17:40         ` Khem Raj
  0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2017-07-25 17:40 UTC (permalink / raw)
  To: Viditha Murahari; +Cc: bitbake-devel

On Tue, Jul 25, 2017 at 8:46 AM, Viditha Murahari
<viditha@mpconsultants.org> wrote:
> Figured out the issue, it was actually a silly mistake
>
> ${CC} ${CFLAGS} ${LDFLAGS} rttapp.c -o rttapp
> should have been
> ${CC} rttapp.c ${CFLAGS} ${LDFLAGS} -o rttapp
>
good. yes link order is important

> On Mon, Jul 24, 2017 at 10:41 AM, Viditha Murahari
> <viditha@mpconsultants.org> wrote:
>>
>> Hello Khem Raj,
>>
>> I did a bitbake -e -c compile -f rttapp  , and this is how my  do_c0mpile
>> command looks
>>
>> do_compile() {
>>         arm-poky-linux-gnueabi-gcc  -march=armv7ve -mfpu=neon
>> -mfloat-abi=hard -mcpu=cortex-a7
>> --sysroot=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/sysroots/imx6ulevk
>> -I/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/include
>> -DPJ_AUTOCONF=1 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -O2 -pipe -g
>> -feliminate-unused-debug-types
>> -fdebug-prefix-map=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1=/usr/src/debug/rttapp/1.0-r1
>> -fdebug-prefix-map=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/sysroots/x86_64-linux=
>> -fdebug-prefix-map=/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/sysroots/imx6ulevk=
>> -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed
>> -L/home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib
>> -lpjsua2-arm-poky-linux-gnueabi -lstdc++ -lpjsua-arm-poky-linux-gnueabi -lm
>> -lrt -lpthread -lasound rttapp.c -o rttapp
>> }
>>
>> and i tried
>>
>> ls
>> /home/jeesu/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib
>>
>>
>> jeesu@MPCLinux:~/viditha/imx6ul-evk-audio/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/rttapp/1.0-r1/lib$
>> ls
>> libg7221codec-arm-poky-linux-gnueabi.a
>> libgsmcodec-arm-poky-linux-gnueabi.a
>> libilbccodec-arm-poky-linux-gnueabi.a
>> libpj-arm-poky-linux-gnueabi.a
>> libpjlib-util-arm-poky-linux-gnueabi.a
>> libpjmedia-arm-poky-linux-gnueabi.a
>> libpjmedia-audiodev-arm-poky-linux-gnueabi.a
>> libpjmedia-codec-arm-poky-linux-gnueabi.a
>> libpjmedia-videodev-arm-poky-linux-gnueabi.a
>> libpjnath-arm-poky-linux-gnueabi.a
>> libpjsip-arm-poky-linux-gnueabi.a
>> libpjsip-simple-arm-poky-linux-gnueabi.a
>> libpjsip-ua-arm-poky-linux-gnueabi.a
>> libpjsua2-arm-poky-linux-gnueabi.a
>> libpjsua-arm-poky-linux-gnueabi.a
>> libresample-arm-poky-linux-gnueabi.a
>> libspeex-arm-poky-linux-gnueabi.a
>> libsrtp-arm-poky-linux-gnueabi.a
>> pkgconfig
>>
>> It looks like -L in my compile command is pointing to the right location
>> for my libraries. So im not clear what im missing. Please help.
>>
>> On Fri, Jul 21, 2017 at 7:25 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>
>>>
>>> On Fri, Jul 21, 2017 at 6:43 PM Andre McCurdy <armccurdy@gmail.com>
>>> wrote:
>>>>
>>>> On Fri, Jul 21, 2017 at 12:11 PM, Viditha Murahari
>>>> <viditha@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@lists.openembedded.org
>>>> > http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>>>> >
>>>> --
>>>> _______________________________________________
>>>> bitbake-devel mailing list
>>>> bitbake-devel@lists.openembedded.org
>>>> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>>
>>
>
>
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-25 17:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21 19:11 need help to write a recipe to link a static library to my application Viditha Murahari
2017-07-21 19:15 ` kris duff
2017-07-21 22:42 ` Andre McCurdy
2017-07-22  0:25   ` Khem Raj
2017-07-24 15:40     ` Viditha Murahari
2017-07-24 15:41     ` Viditha Murahari
2017-07-25 15:46       ` Viditha Murahari
2017-07-25 17:40         ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.