Ffmpeg compilation failed due to undefined _x264_encoder_open_112 symbol for x86_64 architecture

I am compiling ffmpeg on Snow Leopard from the source. Using Macport is not an option since I have a special modification in ffmpeg. Make commands:

$ ./configure --enable-gpl --enable-libmp3lame --enable-static \ --disable-shared --enable-libx264 --enable-pthreads \ --disable-doc --enable-avfilter $ make 

Error:

 CC ffplay.o ffplay.c: In function 'SDL_main': ffplay.c:3157: warning: assignment discards qualifiers from pointer target type LD ffplay_g Undefined symbols for architecture x86_64: "_x264_encoder_open_112", referenced from: _X264_init in libavcodec.a(libx264.o) ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make: *** [ffplay_g] Error 1 

I compiled libx264 from a source that went fine.

 $ cd x264-snapshot-20101228-2245; ./configure && make && sudo make install 

... and it contains the symbol "_x264_encoder_open_112"

 $ nm ./libx264.a | grep _x264_encoder_open_112 0000000000003ef0 T _x264_encoder_open_112 000000000000d7b0 S _x264_encoder_open_112.eh 

What could be wrong?

+4
source share
3 answers

There was a conflict between similar libs names from /opt/local/lib and /usr/lib . The first is supported by Macport, and the second by my own dev area. Since I wanted to use the last location, I had to remove / temporarily rename those that were in /opt/local/lib to force gcc to select them from /usr/lib

The paths may vary in your case, but you get the idea.

If you have a cleaner way to achieve this, I'm all ears

+3
source

Try setting up x264 with --enable-static.

I had a similar problem and that was the solution for me.

0
source

I am going to add this problem for Homebrew users on Mac OSX:

I had extra libx264 libs in /usr/lib and I had to remove.

This led to an error when building ffmpeg using brew install ffmpeg --use-clang or brew install ffmpeg --use-gcc :

 LD libavcodec/libavcodec.53.dylib AR libavcodec/libavcodec.a Undefined symbols for architecture x86_64: "_x264_bit_depth", referenced from: _X264_init_static in libx264.o _X264_frame in libx264.o "_x264_picture_init", referenced from: _X264_frame in libx264.o "_x264_param_default_preset", referenced from: _X264_init in libx264.o "_x264_param_apply_fastfirstpass", referenced from: _X264_init in libx264.o "_x264_param_apply_profile", referenced from: _X264_init in libx264.o "_x264_encoder_open_120", referenced from: _X264_init in libx264.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make: *** [libavcodec/libavcodec.53.dylib] Error 1 

Additional files:

 /usr/lib/libx264.79.dylib /usr/lib/libx264.a /usr/lib/libx264.dylib 

However, these versions may vary. After removal, the assembly was successful.

Leaving this answer here, because it was very confusing, trying to find a connection with libavcodec failed.

0
source

All Articles