Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Add libraries to new Project

When i created a project this time (this morning) I chose managed build but also Open GL  ES 1.1 app template, don't suspect it matters but just thought i'd better make clear.

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Add libraries to new Project

It very well could be that I built it with the bb10 ndk rather than playbook, or that I built it on osx... you'll probably want to just get it building yourself.

 

To just go ahead and rule it out, you can also download that camera sample and try to see if it builds in Momentics without any changes. If it doesn't, then its gotta be something different between our environments. Just that FFCameraSample should be able to build on its own without anything else (I copied into it what it needed).

Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Add libraries to new Project

Hi mreed, The output when building camera sample..

 


**** Build of configuration Default for project FFCameraSample ****

make Device-Debug
sh mkpri.sh FFCameraSample.pri
C:/bbndk-2.1.0-beta1/host/win32/x86/usr/bin/qmake -spec unsupported/blackberry-armv7le-g++ -o arm/Makefile FFCameraSample.pro CONFIG+=device
process_begin: CreateProcess(NULL, C:/bbndk-2.1.0-beta1/host/win32/x86/usr/bin/qmake -spec unsupported/blackberry-armv7le-g++ -o arm/Makefile FFCameraSample.pro CONFIG+=device, ...) failed.
make (e=2): The system cannot find the file specified.

make: *** [Makefile] Error 2

**** Build Finished ****

 

 

I tried to grab the folders from the sample and see if i could get further with my own app. I added a lot of folders to includes/libraries again and got to the point where it wasn't complaining about not find avformat, avcodec, avutil.

 

I think I got to the point where it recognises ffmpeg, the functions are available to call, do I have to use 

#include <avformat.h>
#include <avcodec.h> in my class or is my including them in the includes folder enough (it doesn't like them so not sure)?

 

So there the error/output I finally get now is 

 

 


**** Build of configuration Device-Debug for project test3 ****

**** Internal Builder is used for build ****
qcc -o src\main.o ..\src\main.c -V4.4.2,gcc_ntoarmv7le -w1 -IC:/bbndk-2.1.0-beta1/target/qnx6/usr/include/freetype2 -IC:\ndk-2.1.0-workspace\test3\libx264\include -IC:\ndk-2.1.0-workspace\test3\libx264\include -IC:\ndk-2.1.0-workspace\test3\libx264\lib\armle-v7 -IC:\ndk-2.1.0-workspace\test3\libx264 -IC:\ndk-2.1.0-workspace\test3\public -IC:\ndk-2.1.0-workspace\test3\ffmpeg -IC:\ndk-2.1.0-workspace\test3\ffmpeg\include -IC:/bbndk-2.1.0-beta1/target/qnx6/../target-override/usr/include -D_FORTIFY_SOURCE=2 -DUSING_GL11 -c -O0 -g -fstack-protector-all
qcc -o test3 src\main.o src\bbutil.o -lbps -lavutil -lavcodec -lavformat -lscreen -lEGL -lGLESv1_CM -lfreetype -lpng -lm -V4.4.2,gcc_ntoarmv7le -w1 -g -Wl,-z,relro -Wl,-z,now -LC:\ndk-2.1.0-workspace\test3\ffmpeg\include -LC:\ndk-2.1.0-workspace\test3\libx264\lib -LC:\ndk-2.1.0-workspace\test3\libx264\lib\armle-v7 -LC:\ndk-2.1.0-workspace\test3\public -LC:\ndk-2.1.0-workspace\test3\public -LC:/bbndk-2.1.0-beta1/target/qnx6/../target-override/armle-v7/usr/lib -LC:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7
C:\bbndk-2.1.0-beta1\host\win32\x86\usr\bin\ntoarm-ld: warning: libx264.so.125, needed by C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavutil.so, not found (try using -rpath or -rpath-link)
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_bit_depth'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_encoder_open_125'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_param_apply_fastfirstpass'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_encoder_encode'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_encoder_reconfig'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_param_default'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_encoder_headers'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_picture_init'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_encoder_close'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_param_default_preset'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_encoder_delayed_frames'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_param_parse'
C:\ndk-2.1.0-workspace\test3\ffmpeg\lib\gpl\armle-v7/libavcodec.so: undefined reference to `x264_param_apply_profile'
cc: C:/bbndk-2.1.0-beta1/host/win32/x86/usr/bin/ntoarm-ld caught signal 1
Build error occurred, build is stopped
Time consumed: 891 ms.

 

Thanks for your patience mreed.

 

Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Add libraries to new Project

got past the last compile error by adding x264 as a library also, I then learnt that it was #include <libavformat/avformat.h> i had to use, not #include <avformat.h>  and then it builds with ffmpeg functions being called.

 

Thanks for all your help, I can't wait to start with ffmpeg.

 

C

Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Add libraries to new Project

spoke too soon! - Just loaded onto device and I get

 

 ldd:FATAL: Could not load library libavutil.so.51.

 

I haven't the time to look into it more right now but if anyone has a reason for this it would help me.

 

Thanks

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Add libraries to new Project

For that last error just make sure that lib file (with the .51 at the end) is mentioned in the BAR descriptor.

Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Add libraries to new Project

[ Edited ]

Properly linking to relevent libraries as mentioned in read me of libffbb does indeed fix the issue of cant load so now for some coding!

 

Thanks mreed, you deserve a medal walking me through this!

Visitor
liyiyan19
Posts: 1
Registered: ‎09-16-2013
My Device: BB Z10 - 10.1.0.4181

Re: Add libraries to new Project

@mreed, I was able to compile the project, but when I tried to run the project, I keep on getting "ldd:FATAL: Could not load library libavformat.so.54".

I think that the BAR descriptor is properly updated with .54 at the end. Do you have any suggestion what might have gone wrong here?

I am pretty new to this, please be slow.