Log in

View Full Version : undefined reference to `sws_format_name'


bnshrdr
1st June 2011, 22:19
Hey I've been out of the scene for a while and just tried to compile x264 again and managed to seemingly correctly compile all of its dependencies. However, when I compile x264, the very last step of the Makefile where all the linking is done, I get this error. I checked for the function, and it really does not exist in ffmpeg's swscale (the most recent revision).

filters/video/resize.o:resize.c:(.text+0x7be): undefined reference to `sws_format_name'
filters/video/resize.o:resize.c:(.text+0x7cc): undefined reference to `sws_format_name'
filters/video/resize.o:resize.c:(.text+0xe84): undefined reference to `sws_format_name'
filters/video/resize.o:resize.c:(.text+0x111b): undefined reference to `sws_format_name'
filters/video/resize.o:resize.c:(.text+0x1188): undefined reference to `sws_format_name'
collect2: ld returned 1 exit status
make: *** [x264.exe] Error 1

Anyone else run into this or have a solution?

Chikuzen
1st June 2011, 22:58
There are three ways that you can choose.

1. Use Libav's libraries instead of FFmpeg's.
 Libav libraries have no problem at present.
2. Wait for someone to write the patch for x264 or FFmpeg.
 When Libav broke API, Anton Kirnov(Libav developper) did it before. (http://git.videolan.org/?p=x264.git;a=commit;h=f5db2e4a90d536b6665e7a5913ad4648fc918077)
3. Write a patch yourself, and submit it to x264 or FFmpeg.

bnshrdr
1st June 2011, 23:08
There are three ways that you can choose.

1. Use Libav's libraries instead of FFmpeg's.
 Libav libraries have no problem at present.
Wow, I guess I've been out of it for a while. I didn't even know there was a project called Libav. I'll give that a try. Hopefully the API will match up nicely :P

Edit: Worked great! Thanks!

wipple
3rd June 2011, 01:18
FYI
FFmpeg reintroduced sws_format_name() symbol.
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=b932eb1be62b47b29969667f14a207e425e79a55
Neither FFmpeg nor Libav causes this error now.