[Libav-user] Unable to link libavutil with libswscale !

ssshukla26 ssshukla26 at gmail.com
Fri Jul 8 11:32:54 CEST 2016


We are adding *nv12 tile* to *yuv420p* format conversion support in
*libswscale*. While adding the support we also found out that the size
calculation under *av_image_fill_pointers function* under
*libavutil/imgutils.c* file also needed to be changed. 

Hence we added support under *libavutil* by making two new files
*special_format.c* and *special_format.h*, and used it along with
*imgutils.c*. 

This special_format.h is consist of four functions namely,
nv12tile_calc_wTiles
nv12tile_calc_hTiles
nv12tile_calc_boundary_padding
nv12tile_calc_plane_size

We used this functions by including *special_format.h* inside
*nv12tileconversion.c* file (our conversion algo is placed in this file)
inside *libswscale* as follows. 
...
...
*#include "libavutil/special_format.h"*
...
...

But on compiling its giving the below errors.

-----------------------------------------------------------------------------------
libswscale/libswscale.so: undefined reference to `nv12tile_calc_wTiles'
libswscale/libswscale.so: undefined reference to `nv12tile_calc_plane_size'
libswscale/libswscale.so: undefined reference to `nv12tile_calc_hTiles'
collect2: error: ld returned 1 exit status
make: *** [ffplay_g] Error 1
make: *** Waiting for unfinished jobs....
libswscale/libswscale.so: undefined reference to `nv12tile_calc_wTiles'
libswscale/libswscale.so: undefined reference to `nv12tile_calc_plane_size'
libswscale/libswscale.so: undefined reference to `nv12tile_calc_hTiles'
collect2: error: ld returned 1 exit status
make: *** [ffprobe_g] Error 1
libswscale/libswscale.so: undefined reference to `nv12tile_calc_wTiles'
libswscale/libswscale.so: undefined reference to `nv12tile_calc_plane_size'
libswscale/libswscale.so: undefined reference to `nv12tile_calc_hTiles'
collect2: error: ld returned 1 exit status
make: *** [ffserver_g] Error 1
libswscale/libswscale.so: undefined reference to `nv12tile_calc_wTiles'
libswscale/libswscale.so: undefined reference to `nv12tile_calc_plane_size'
libswscale/libswscale.so: undefined reference to `nv12tile_calc_hTiles'
collect2: error: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
-----------------------------------------------------------------------------------

To solve this we added the lines (in bold as show below) in *Makefile* under
*libswscale*,

-----------------------------------------------------------------------------------
include $(SUBDIR)../config.mak

NAME = swscale

HEADERS = swscale.h \
          version.h \

OBJS = alphablend.o                 \
       hscale.o                     \
       hscale_fast_bilinear.o       \
       gamma.o                      \
       input.o                      \
       options.o                    \
       output.o                     \
       rgb2rgb.o                    \
       slice.o                      \
       swscale.o                    \
       swscale_unscaled.o           \
       utils.o                      \
       yuv2rgb.o                    \
       vscale.o                     \
       nv12tiledconversion.o             \
*       ./libavutil/special_format.o \*
       
OBJS-$(CONFIG_SHARED)        += log2_tab.o

# Windows resource file
SLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o

TESTPROGS = colorspace  \
            swscale
-----------------------------------------------------------------------------------

My question is how can I compile the ffmpeg libraries *without including*
special_format.o object reference under libswscale Makefile ? 

The reason why am asking this questions is that I have seen many files under
libswscale using files from under libavutil and they are compiling fine, but
am not able to find out why we are facing this errors ! Please help.

*Note* :- configuration of ffmpeg is as show below.

export SDL_PATH=../sdl/

./configure  --enable-shared --enable-nonfree --enable-pic --enable-gpl
--extra-cflags="-I$SDL_PATH/include/SDL/" --extra-ldflags="-L$SDL_PATH/lib/
-lSDL"



--
View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Unable-to-link-libavutil-with-libswscale-tp4662334.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list