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
Posts: 160
Registered: ‎09-13-2012
My Device: 9900
My Carrier: vodafone

Re: ffmpeg compile issue

It just won't run with avformat avcodec avutil in the LIBS += section of common.mk file. It accepts ARCH =. I have added the folder ffmpeg/include public and ffmpeg/lib to my includes in properties/paths and symbols and I can see them with the correct colored icon (purple like camera sample has these folders in its project) in my includes folder in project explorer.

 

What I haven't done is set/messed about with EXTRA_INCVPATH or EXTRA_LIBVPATH because I dont know what to put in there - the absolute file path to the includes and public maybe? There was an option to add a library by adding an includes folder and then a library file for device and simulator but couldnt find a file which would be accepted as a library file. But maybe I have already done this in paths and symbols anyway?

 

My paths as they are now..

 

# Extra include path for libfreetype and for target overrides and patches
EXTRA_INCVPATH+=$(QNX_TARGET)/usr/include/freetype2 \
$(QNX_TARGET)/../target-override/usr/include

# Extra library search path for target overrides and patches
EXTRA_LIBVPATH+=$(QNX_TARGET)/../target-override/$(CPUVARDIR)/lib \
$(QNX_TARGET)/../target-override/$(CPUVARDIR)/usr/lib

 

 

 

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

Re: ffmpeg compile issue

If you are doing a makefile project, I don't think what you put in the path/symbols settings in preferences is even going to be used.

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

Re: ffmpeg compile issue

I have gotten somewhere with 

 

# Extra include path for libfreetype and for target overrides and patches
EXTRA_INCVPATH+=$(QNX_TARGET)/usr/include/freetype2 \
$(QNX_TARGET)/../target-override/usr/include \ C:/ndk-2.1.0-workspace/test/ffmpeg/include

# Extra library search path for target overrides and patches
EXTRA_LIBVPATH+=$(QNX_TARGET)/../target-override/$(CPUVARDIR)/lib \
$(QNX_TARGET)/../target-override/$(CPUVARDIR)/usr/lib \ C:/ndk-2.1.0-workspace/test/ffmpeg/lib

 

I now find that the imports don't actually throw an error and i can f3 to avformat!!

 

However, I have 3 errors which just show *** Error 1 or 2. What can I do with errors like that?

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

Re: ffmpeg compile issue

Can you paste the full error message.

 

You should be able to use a canonical path starting wtih ../ffmpeg/include or ../../ffmpeg/include rather than C:/<path>. I'm not sure which folder its running make out of, so try different lengths of ../ till it can find it.

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

Re: ffmpeg compile issue


**** Build of configuration Default for project finaltest ****

make all
make -j 1 -Carm -fMakefile all
make[1]: Entering directory `C:/ndk-2.1.0-workspace/finaltest/arm'
make -j 1 -Co.le-v7 -fMakefile all
make[2]: Entering directory `C:/ndk-2.1.0-workspace/finaltest/arm/o.le-v7'
C:/bbndk-2.1.0-beta1/host/win32/x86/usr/bin/qcc -Vgcc_ntoarmv7 -c -O -Wc,-Wall -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -frecord-gcc-switches -DNDEBUG -I. -IC:/ndk-2.1.0-workspace/finaltest/arm/o.le-v7 -IC:/ndk-2.1.0-workspace/finaltest/arm -IC:/ndk-2.1.0-workspace/finaltest -IC:/bbndk-2.1.0-beta1/target/qnx6/usr/include/freetype2 -IC:/bbndk-2.1.0-beta1/target/qnx6/../target-override/usr/include -I\ -IC:/ndk-2.1.0-workspace/finaltest/ffmpeg/include -IC:/ndk-2.1.0-workspace/finaltest/public -IC:/bbndk-2.1.0-beta1/target/qnx6/usr/include -EL -DVARIANT_le -DVARIANT_v7 -DBUILDENV_qss C:/ndk-2.1.0-workspace/finaltest/main.c
cc1: error: "-I -IC:/ndk-2.1.0-workspace/finaltest/ffmpeg/include": Invalid argument
make[2]: Leaving directory `C:/ndk-2.1.0-workspace/finaltest/arm/o.le-v7'
cc: C:/bbndk-2.1.0-beta1/host/win32/x86/usr/lib/gcc/arm-unknown-nto-qnx6.5.0eabi/4.4.2/cc1 caught signal 1
make[1]: Leaving directory `C:/ndk-2.1.0-workspace/finaltest/arm'
make[2]: *** [main.o] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2

**** Build Finished ****

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

Re: ffmpeg compile issue

[ Edited ]

The error is:

cc1: error: "-I -IC:/ndk-2.1.0-workspace/finaltest/ffmpeg/include": Invalid argument

 

Try taking out the \ before your include and lib path, and/or try putting a line break after it. The use of \ in command lines is just so you can use line breaks.

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

Re: ffmpeg compile issue

if i take the \ seperator out the includes go back to not being recognized, if i add \ at the end or with a space before it the same error occurs.

 

Why does it have -I -I ?

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

Re: ffmpeg compile issue

[ Edited ]

did you try with a linebreak after the \?

 

# Extra include path for libfreetype and for target overrides and patches
EXTRA_INCVPATH+=$(QNX_TARGET)/usr/include/freetype2 \
$(QNX_TARGET)/../target-override/usr/include \

C:/ndk-2.1.0-workspace/test/ffmpeg/include

# Extra library search path for target overrides and patches
EXTRA_LIBVPATH+=$(QNX_TARGET)/../target-override/$(CPUVARDIR)/lib \
$(QNX_TARGET)/../target-override/$(CPUVARDIR)/usr/lib \

C:/ndk-2.1.0-workspace/test/ffmpeg/lib

 

-I (eye) is for adding and include path. -l (ell) is for a library. I think the empty "-I " is because of the \

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

Re: ffmpeg compile issue

that actually fixs the issue but brings back the older issues - not recognizing my includes avformat (ffmpeg code) even though if i press f3 it will show me the header file of avformat)and then also it doesn't like  avformat avcodec avutil when added to LIBS +=.

 

It wil only build without the ffmpeg includes and LIBS +=.

 

I feel like im going round in circles

 

 

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

Re: ffmpeg compile issue

Can you post your current EXTRA_INCVPATH, EXTRA_LIBVPATH, LIBS variables and the build output.