0

I have copied compiled FFMPEG libraries from a test app into my xcode-project but inspite of adding them into my project i am unable to use them,

#include <libavcodec/avcodec.h>

givers error even all the complied libraries (libavcodec.a, libavutil.a, libavformat.a, libavdevice.a> all are specified in link libraries as required framework.

lowtechsun
  • 1,915
  • 5
  • 27
  • 55
Muzammal Hussain
  • 377
  • 4
  • 14
  • 2
    what are the errors ? – Raptor May 21 '13 at 06:28
  • #include is indicated as unknown syntax by x-code (appears red underlined). – Muzammal Hussain May 21 '13 at 07:08
  • @user1744691, how did you manage to compile the ffmpeg libraries and add it in your xcode proj ? Any interesting tuto ? – Luc May 26 '13 at 13:27
  • nothing fancy, after reading a bunch of tutorials i found that i can use already compiled libraries so i downloaded an ffmpeg project from git hub copied its .a files to my project also copied header/include folder into my project and set search path...... ready to go. – Muzammal Hussain May 27 '13 at 02:32

2 Answers2

1

when you say you copied libs into your project some questions come up.

(1) where did you copy the libs for, are they (armv6, armv7. i386) or fat universal. (2) did you add the libs in Xcode (3) where are the includes for the libs, is the search path for them correctly set in Xcode

Michelle Cannon
  • 1,341
  • 8
  • 8
  • that are (armv7 and armv7s). I added them in Xcode4.5. I puth the includes in Xcode's include folder. – Muzammal Hussain May 22 '13 at 05:46
  • i don't know what search path is and how to set it. – Muzammal Hussain May 22 '13 at 05:59
  • 1
    go into your Xcode build settings, type search path, and in Header search path put the path to were ever you have the include, for instance if the includes are one directory above the project directory in a folder called ffmpeg your path would be ../ffmpeg/**, if you don't care about version our ffmpegDecoder.framework can be obtained from our github page. You just drag the framework into your project and your done – Michelle Cannon May 22 '13 at 14:05
  • @MichelleCannon I was trying to find the .framework by googling ffmpegDecoder.framework but could not find it. Do you have a link to the page by chance. Thank you. – Patrick Ridd Aug 12 '20 at 18:43
0

The correct syntax is:

#import <libavcodec/avcodec.h>

instead of #include

Raptor
  • 53,206
  • 45
  • 230
  • 366
  • sorry i typed wrongly #import actually it does not work for #include as well as for #import. – Muzammal Hussain May 21 '13 at 11:41
  • what's the error again ? `#import ` is a valid syntax . – Raptor May 22 '13 at 03:24
  • nothing but no intelisense appears for the syntax and its other header files, if i write them manually Xcode counts it as error (library/header file not found). – Muzammal Hussain May 22 '13 at 05:48
  • intelisense ? sounds like you are working in Visual Studio. Can you paste the whole file content in pastebin.com or something similar? I try to help after I have the whole picture. – Raptor May 22 '13 at 05:56