brokedid
brokedid

Reputation: 899

Compiling ffmpeg for iPhone SDK (Symbol(s) not found - Linker)

I'm using ffplay in my Application. I implemented the Librarys which has been used in this Project: http://code.google.com/p/ffmpeg4iphone/downloads/detail?name=ffplay-xproj.zip&can=2&q=

But I've seen that this Sources are very old(Apr 2009). I wanted to Build new Librarys and then change it with these In my project.

What I've done:

  1. Downloaded the ffmpeg Source code: (using command line: svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg)
  2. Compiled the Project with special ./configure options and the gas-processor : http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html
  3. I only changed here the Paths of the actual locations for the iPhone SDK 4.1
  4. Changed the header Path in xCode Active Target Project Settings to my ffmpeg folder
  5. Included the .a files in my project in xCode
  6. Added the Other Linker Flags -lm -lbz2 -lz
  7. Tried to Build my Application, but I get some Linker errors where symbol(s) wasn't found.

Undefined symbols: "avcodec_init()", referenced from:

And the other errors are nearly the same (_av_codec.....)

How can I build it correctly?

Upvotes: 5

Views: 3256

Answers (2)

brokedid
brokedid

Reputation: 899

I've found the solution: I set the architecture to Optimized(arm7) and then all was working.

One more Question: I use ffmpeg for streaming an online stream. Which Values Should I set to get a good streaming quality also when I am in 3G. This what i've done:

  • set the audio-buffer to 1024
  • set the lowres value of mpeg to 3

Upvotes: 1

Viren
Viren

Reputation: 2171

Not sure if you are using C or C++ (g++) compiler, but try guarding your #includes for ffmpeg with extern "C": the c++ compiler (if it is used) is probably mangling the function names and hence the link errors.

Try to enclose your include with extern "C":

#ifdef __cplusplus
extern "C" {
#endif 

#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>

#ifdef __cplusplus
}
#endif 

Upvotes: 0

Related Questions