[FFmpeg-devel] haunted by "undefined reference to `vaUnmapBuffer'"

Sampsa Riikonen sampsa.riikonen at iki.fi
Tue Oct 31 21:38:42 EET 2017


Dear List,

I am compiling a stripped-down, static versions of the libraries, i.e. :

libavcodec.a libavformat.a libavutil.a libswscale.a libavfilter.a 
libswresample.a

and I'm "baking them in" into a custom shared-library.

All external libraries are disabled, and configure script tells me that:

---------------------
...
Enabled programs:
ffmpeg                  ffprobe                 ffserver

External libraries:

Enabled decoders:
h263                    h264                    vc1

Enabled encoders:
rawvideo

Enabled hwaccels:

Enabled parsers:
...
--------------------------

i.e., no external libraries, no hw accelerators, etc.

I link with

/usr/bin/c++  -fPIC -g  -shared -Wl,-soname,libValkka.so.0 -o 
lib/libValkka.so.0.1.0 CMakeFiles/Valkka.dir/src/avthread.cpp.o 
CMakeFiles/Valkka.dir/src/opengl.cpp.o 
CMakeFiles/Valkka.dir/src/openglthread.cpp.o 
CMakeFiles/Valkka.dir/src/frames.cpp.o 
CMakeFiles/Valkka.dir/src/threads.cpp.o 
CMakeFiles/Valkka.dir/src/tools.cpp.o 
CMakeFiles/Valkka.dir/src/chains.cpp.o 
CMakeFiles/Valkka.dir/src/shaders.cpp.o 
CMakeFiles/Valkka.dir/src/logging.cpp.o 
CMakeFiles/Valkka.dir/src/live.cpp.o 
CMakeFiles/Valkka.dir/src/avdep.cpp.o 
CMakeFiles/Valkka.dir/src/queues.cpp.o 
CMakeFiles/Valkka.dir/src/livethread.cpp.o 
CMakeFiles/Valkka.dir/src/decoders.cpp.o 
CMakeFiles/Valkka.dir/src/filters.cpp.o -lX11 -lGLEW -lGLU -lGL 
-L/home/sampsa/C/valkka/lib -Wl,--allow-multiple-definition 
-Wl,-Bsymbolic -Wl,--start-group -Wl,--whole-archive -l:libliveMedia.a 
-l:libgroupsock.a -l:libBasicUsageEnvironment.a -l:libUsageEnvironment.a 
-l:libavfilter.a -l:libavformat.a -l:libavcodec.a -l:libavutil.a 
-l:libswscale.a -l:libswresample.a -Wl,--no-whole-archive -Wl,--end-group

But when creating executables

/usr/bin/c++   -g CMakeFiles/threads_test.dir/test/threads_test.cpp.o  
-o bin/threads_test -rdynamic -lValkka 
-L/home/sampsa/C/valkka/build_basic/lib
/home/sampsa/C/valkka/build_basic/lib/libValkka.so: undefined reference 
to `vaUnmapBuffer'
/home/sampsa/C/valkka/build_basic/lib/libValkka.so: undefined reference 
to `vaDestroyBuffer'
/home/sampsa/C/valkka/build_basic/lib/libValkka.so: undefined reference 
to `vaCreateBuffer'
/home/sampsa/C/valkka/build_basic/lib/libValkka.so: undefined reference 
to `vaRenderPicture'
/home/sampsa/C/valkka/build_basic/lib/libValkka.so: undefined reference 
to `vaMapBuffer'
/home/sampsa/C/valkka/build_basic/lib/libValkka.so: undefined reference 
to `vaEndPicture'
/home/sampsa/C/valkka/build_basic/lib/libValkka.so: undefined reference 
to `vaBeginPicture

There's no freaking way to get rid of these vaapi-related symbols..!  I 
used to be able to do this with an older (1 year+) version of the code, 
but now I'm getting way too much gray hair. I'm trying to do this with 
the git branch

origin/release/3.0

It seems they come about in the following way:

----
grep -nr "vaUnmap"

libavcodec/vaapi.c:79:    vaUnmapBuffer(vactx->display, 
vactx->pic_param_buf_id);
libavcodec/vaapi.c:83:        vaUnmapBuffer(vactx->display, 
vactx->iq_matrix_buf_id);
libavcodec/vaapi.c:88:        vaUnmapBuffer(vactx->display, 
vactx->bitplane_buf_id);
Binary file libavcodec/vaapi.o matches
Binary file libavcodec/libavcodec.so.57 matches
Binary file libavcodec/libavcodec.a matches
-----

My own code is in cpp and in my header files I do:

------
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/log.h>
#include <libswscale/swscale.h>
}
------

Growing desperate.  Help appreciated!

Regards,

Sampsa




More information about the ffmpeg-devel mailing list