Skip to content

Static libraries giving architecture error #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tarunseera opened this issue Apr 2, 2014 · 18 comments
Closed

Static libraries giving architecture error #2

tarunseera opened this issue Apr 2, 2014 · 18 comments

Comments

@tarunseera
Copy link

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)

@kewlbear
Copy link
Owner

kewlbear commented Apr 2, 2014

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

@kewlbear kewlbear closed this as completed Apr 2, 2014
@tarunseera
Copy link
Author

Thanks, Everything is fine now :)

@kewlbear
Copy link
Owner

kewlbear commented Apr 3, 2014

Glad I could help.

@starmier
Copy link

starmier commented Jul 1, 2015

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

@insidegui
Copy link

insidegui commented Aug 24, 2015

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
Copy link

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
Copy link
Owner

Have you link libz?

@bintu1234
Copy link

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

@kewlbear
Copy link
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
Copy link

Thanks its working now

@PandaraWen
Copy link

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
Copy link

kid9591 commented Nov 21, 2017

@kewlbear thank! you saved my day.

@tjayrush
Copy link

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
Copy link
Owner

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

@PrashantKT
Copy link

I am getting error

Undefined symbols for architecture arm64:
"_CMTimeMake", referenced from:
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
"_kCMTimeInvalid", referenced from:
_vtenc_send_frame in libavcodec.a(videotoolboxenc.o)
"_CMSampleBufferGetSampleAttachmentsArray", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
"_kCMSampleAttachmentKey_NotSync", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
"_CMSampleBufferGetTotalSampleSize", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
"_CMSampleBufferGetDataBuffer", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
"_CMSampleBufferGetFormatDescription", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
_vtenc_output_callback in libavcodec.a(videotoolboxenc.o)
"_CMBlockBufferCopyDataBytes", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
"_BZ2_bzDecompress", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_kCMTimeIndefinite", referenced from:
_vtenc_init in libavcodec.a(videotoolboxenc.o)
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
_vtenc_close in libavcodec.a(videotoolboxenc.o)
"_CMBlockBufferCreateWithMemoryBlock", referenced from:
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
"_CMSampleBufferCreate", referenced from:
_videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o)
"_BZ2_bzDecompressInit", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms", referenced from:
_videotoolbox_default_init in libavcodec.a(videotoolbox.o)
"_CMSampleBufferGetDecodeTimeStamp", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
"_CMVideoFormatDescriptionCreate", referenced from:
_videotoolbox_default_init in libavcodec.a(videotoolbox.o)
"_CMVideoFormatDescriptionGetH264ParameterSetAtIndex", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
_get_params_size in libavcodec.a(videotoolboxenc.o)
_copy_param_sets in libavcodec.a(videotoolboxenc.o)
"_CMSampleBufferGetPresentationTimeStamp", referenced from:
_vtenc_frame in libavcodec.a(videotoolboxenc.o)
"_BZ2_bzDecompressEnd", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have already added

libiconv.tdb, libz.tdb,videotoolbox.framework,audiotoolbox.framework

Please help

@kewlbear
Copy link
Owner

kewlbear commented Oct 31, 2018

I guess from the prefix “CM” you need CoreMedia framework. If you encounter this kind of error, you can always google the symbol causing the error.

@PrashantKT
Copy link

@kewlbear That works , Thank you so much. I did't noticed CM ... 100 Thumbs up

@harshalijain
Copy link

Thank you for the CoreMedia.framework solution that helped me to fix an issue in another library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants