Skip to content

Static libraries giving architecture error #2

Closed
@tarunseera

Description

@tarunseera

I am able to compile ffmpeg library but when integrate static library of ffmpeg its still giving undefined symbol error for various architecture.
I have tried with http://sourceforge.net/projects/ffmpeg-ios/postdownload?source=dlp too but this is giving same error
Undefined symbols for architecture armv7:
"_BZ2_bzDecompressInit", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_iconv", referenced from:
_avcodec_decode_subtitle2 in libavcodec.a(utils.o)
"_BZ2_bzDecompress", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompressEnd", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_iconv_open", referenced from:
_avcodec_open2 in libavcodec.a(utils.o)
_avcodec_decode_subtitle2 in libavcodec.a(utils.o)
"_iconv_close", referenced from:
_avcodec_open2 in libavcodec.a(utils.o)
_avcodec_decode_subtitle2 in libavcodec.a(utils.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Activity

kewlbear

kewlbear commented on Apr 2, 2014

@kewlbear
Owner

You have to link with libbz2.dylib and libiconv.dylib.

tarunseera

tarunseera commented on Apr 2, 2014

@tarunseera
Author

Thanks, Everything is fine now :)

kewlbear

kewlbear commented on Apr 3, 2014

@kewlbear
Owner

Glad I could help.

starmier

starmier commented on Jul 1, 2015

@starmier

Thanks . I encounter the same situation, and It can work for me .

insidegui

insidegui commented on Aug 24, 2015

@insidegui

I don't know if it changed, but I had to link against libbz2.1.0.dylib for it to work, libbz2.dylib didn't.

bintu1234

bintu1234 commented on Feb 10, 2016

@bintu1234

HI all I'm also phasing same issue i just add above lib but still it is showing some errors like below

Undefined symbols for architecture x86_64:
"_inflate", referenced from:
_http_read in libffmpeg.a(http.o)
_matroska_decode_buffer in libffmpeg.a(matroskadec.o)
_rtmp_open in libffmpeg.a(rtmpproto.o)
"_inflateEnd", referenced from:
_http_close in libffmpeg.a(http.o)
_http_read_header in libffmpeg.a(http.o)
_matroska_decode_buffer in libffmpeg.a(matroskadec.o)
_rtmp_open in libffmpeg.a(rtmpproto.o)
"inflateInit2", referenced from:
_http_read_header in libffmpeg.a(http.o)
"inflateInit", referenced from:
_matroska_decode_buffer in libffmpeg.a(matroskadec.o)
_rtmp_open in libffmpeg.a(rtmpproto.o)
"_uncompress", referenced from:
_ff_id3v2_read in libffmpeg.a(id3v2.o)
_mov_read_cmov in libffmpeg.a(mov.o)
(maybe you meant: _ssl3_do_uncompress)
"_zlibCompileFlags", referenced from:
_http_read_header in libffmpeg.a(http.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

please help me

kewlbear

kewlbear commented on Feb 10, 2016

@kewlbear
Owner

Have you link libz?

bintu1234

bintu1234 commented on Feb 11, 2016

@bintu1234

yes libbz2.0.1.tbd and libbz2.tbd in xcode 7.2

kewlbear

kewlbear commented on Feb 11, 2016

@kewlbear
Owner

You need libz instead of libbz2. By the way libbz2 is just a symlink to libbz2.0.1, so you don't have to link both.

bintu1234

bintu1234 commented on Feb 11, 2016

@bintu1234

Thanks its working now

PandaraWen

PandaraWen commented on Jul 19, 2016

@PandaraWen

I have linked libz, libiconv, libbz, but the errors are remains the same:
Undefined symbols for architecture x86_64:
"sws_getContext(int, int, AVPixelFormat, int, int, AVPixelFormat, int, SwsFilter_, SwsFilter_, double const*)", referenced from:

Do anyone have some idea? I am getting mad...

kid9591

kid9591 commented on Nov 21, 2017

@kid9591

@kewlbear thank! you saved my day.

tjayrush

tjayrush commented on May 12, 2018

@tjayrush

Why does everyone always say "You have to link XYZ" but never "You have to link XYZ and here's how to do that"? Okay--so now I know what I have to do, but I have no idea how...

kewlbear

kewlbear commented on May 14, 2018

@kewlbear
Owner

@tjayrush Grab a good book on Xcode or google. You should learn such a basic stuff elsewhere.
.

5 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @insidegui@kewlbear@PandaraWen@tjayrush@tarunseera

        Issue actions

          Static libraries giving architecture error · Issue #2 · kewlbear/FFmpeg-iOS-build-script