kewlbear / FFmpeg-iOS-build-script

Shell scripts to build FFmpeg for iOS and tvOS
3.03k stars 899 forks source link

Correctly Linking Libraries #71

Closed AlecGamble closed 8 years ago

AlecGamble commented 8 years ago

Hi Kewlbear,

Firstly thank you so much for making these ffmpeg libraries so accessible. I'm fairly new to software development and I'm trying to include them in my iOS project. It's a cordova application but I don't think that's really relevant to the issue I'm having.

My file structure is like this:

-iOS (folder)
   -App.xcodeproj
   -App (folder)
      -Classes (folder)
      -ffmpeg-ios-master (folder)
         -FFmpeg-iOS (folder)
            -inlcude (folder)
            -lib (folder)
         -ffmpeg-3.0 (folder)
         -scratch (folder)

So the path to the include would be iOS/App/ffmpeg-ios-master/FFmpeg-iOS/include. So I'm trying to use the avcodec and swscale libraries in my project.

I've added to "Link Binary With Libraries" all of the .a files and I've also added "$(SRCROOT)/App/ffmpeg-ios-master/FFmpeg-iOS/include" to the header search paths.

I'm wondering what I'm missing or have done wrong though because I'm getting: Linker command failed with exit code 1.

Is it obvious what I'm doing wrong or have missed out?

AlecGamble commented 8 years ago

Just to add to what I said in the objective C where I'm implementing the ffmpeg it's not throwing up errors in the script itself but it's giving me the error:

Undefined symbols for architecture i386:
...
"_iconv", referenced from:
      _avcodec_decode_subtitle2 in libavcodec.a(utils.o)
...
"_uncompress", referenced from:
      _id3v2_read_internal in libavformat.a(id3v2.o)
      _svq3_decode_init in libavcodec.a(svq3.o)
....
ld: symbol(s) not found for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)
kewlbear commented 8 years ago

You should link with libiconv, libz, libbz2.