Problems compiling obs-studio from source on Debian10

Tixlegeek

New Member
Hi!

I wanted to upgrade my running version of Obs-studio, so i cloned the repository, installed the depedencies, everything as described in https://obsproject.com/wiki/install-instructions#debianlmde-installation-unofficial

unfortunately, i couldn't go pass the cmake. The compiling itself stops at 6%, giving the following errors:


Code:
[  6%] Built target obs-browser-page
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(simple_idct10.o): relocation R_X86_64_PC32 against symbole `ff_pw_32' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vc1dsp_loopfilter.o): relocation R_X86_64_PC32 against symbole `ff_pw_5' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vc1dsp_mc.o): relocation R_X86_64_PC32 against symbole `ff_pw_9' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vc1dsp_mmx.o): relocation R_X86_64_PC32 against symbole `ff_pw_9' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp8dsp_loopfilter.o): relocation R_X86_64_PC32 against symbole `ff_pb_80' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp9intrapred.o): relocation R_X86_64_PC32 against symbole `ff_pw_4' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp9intrapred_16bpp.o): relocation R_X86_64_PC32 against symbole `ff_pw_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp9itxfm.o): relocation R_X86_64_PC32 against symbole `ff_pd_8192' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp9itxfm_16bpp.o): relocation R_X86_64_PC32 against symbole `ff_pw_1023' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp9lpf.o): relocation R_X86_64_PC32 against symbole `ff_pb_80' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp9lpf_16bpp.o): relocation R_X86_64_PC32 against symbole `ff_pw_m1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp9mc.o): relocation R_X86_64_PC32 against symbole `ff_pw_64' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp9mc_16bpp.o): relocation R_X86_64_PC32 against symbole `ff_pw_1023' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against symbole `ff_h264_cabac_tables' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(cavsdsp.o): relocation R_X86_64_PC32 against symbole `ff_pw_5' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(cavsidct.o): relocation R_X86_64_PC32 against symbole `ff_pw_4' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(cfhdencdsp.o): relocation R_X86_64_PC32 against symbole `ff_pw_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(diracdsp.o): relocation R_X86_64_PC32 against symbole `ff_pb_80' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(exrdsp.o): relocation R_X86_64_PC32 against symbole `ff_pb_80' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbole `ff_cos_32' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h263_loopfilter.o): relocation R_X86_64_PC32 against symbole `ff_h263_loop_filter_strength' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_chromamc.o): relocation R_X86_64_PC32 against symbole `ff_pw_8' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_qpel_10bit.o): relocation R_X86_64_PC32 against symbole `ff_pw_1023' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_qpel_8bit.o): relocation R_X86_64_PC32 against symbole `ff_pw_5' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(hevc_add_res.o): relocation R_X86_64_PC32 against symbole `ff_pw_1023' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(hevc_deblock.o): relocation R_X86_64_PC32 against symbole `ff_pw_m1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(hevc_idct.o): relocation R_X86_64_PC32 against symbole `ff_pw_64' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(hevc_mc.o): relocation R_X86_64_PC32 against symbole `ff_pd_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(hevc_sao.o): relocation R_X86_64_PC32 against symbole `ff_pb_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(hevc_sao_10bit.o): relocation R_X86_64_PC32 against symbole `ff_pw_m1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(hpeldsp.o): relocation R_X86_64_PC32 against symbole `ff_pb_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(idctdsp.o): relocation R_X86_64_PC32 against symbole `ff_pb_80' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(lossless_videodsp.o): relocation R_X86_64_PC32 against symbole `ff_pb_15' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(lossless_videoencdsp.o): relocation R_X86_64_PC32 against symbole `ff_pb_80' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(me_cmp.o): relocation R_X86_64_PC32 against symbole `ff_pb_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(pngdsp.o): relocation R_X86_64_PC32 against symbole `ff_pw_255' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(proresdsp.o): relocation R_X86_64_PC32 against symbole `ff_pw_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(qpeldsp.o): relocation R_X86_64_PC32 against symbole `ff_pw_3' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(rv40dsp.o): relocation R_X86_64_PC32 against symbole `ff_pw_32' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(utvideodsp.o): relocation R_X86_64_PC32 against symbole `ff_pb_80' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(v210enc.o): relocation R_X86_64_PC32 against symbole `ff_pw_4' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp3dsp.o): relocation R_X86_64_PC32 against symbole `ff_pb_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp6dsp.o): relocation R_X86_64_PC32 against symbole `ff_pw_64' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(vp8dsp.o): relocation R_X86_64_PC32 against symbole `ff_pw_256' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_cabac.o): relocation R_X86_64_PC32 against symbole `ff_h264_cabac_tables' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(ac3dsp.o): relocation R_X86_64_PC32 against symbole `ff_ac3_bap_bits' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(dirac_dwt.o): relocation R_X86_64_PC32 against symbole `ff_pw_2' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_chromamc_10bit.o): relocation R_X86_64_PC32 against symbole `ff_pw_8' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_deblock.o): relocation R_X86_64_PC32 against symbole `ff_pb_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_deblock_10bit.o): relocation R_X86_64_PC32 against symbole `ff_pw_4' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_idct.o): relocation R_X86_64_PC32 against symbole `ff_pw_32' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_idct_10bit.o): relocation R_X86_64_PC32 against symbole `ff_pd_32' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_intrapred.o): relocation R_X86_64_PC32 against symbole `ff_pb_3' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_intrapred_10bit.o): relocation R_X86_64_PC32 against symbole `ff_pw_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(h264_weight_10bit.o): relocation R_X86_64_PC32 against symbole `ff_pw_1' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavcodec.a(sbrdsp.o): relocation R_X86_64_PC32 against symbole `ff_ps_neg' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libavutil.a(tx_float.o): relocation R_X86_64_PC32 against symbole `ff_cos_32_float' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libswscale.a(swscale.o): relocation R_X86_64_PC32 against symbole `ff_M24A' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld: /usr/local/lib/../lib/libswscale.a(rgb2rgb.o): relocation R_X86_64_PC32 against symbole `ff_w1111' can not be used when making un objet partagé; recompilez avec -fPIC
/usr/bin/ld : échec de l'édition de liens finale : nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [libobs/CMakeFiles/libobs.dir/build.make:1309: libobs/libobs.so.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:682: libobs/CMakeFiles/libobs.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

The CMAKE part seems doing fine:

Code:
cmake -DUNIX_STRUCTURE=1 -DENABLE_PIPEWIRE=OFF -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="../../cef_binary_4280_linux64" ..
-- OBS_VERSION: 27.0.1-84-g725fce78b
-- Found FFmpeg: /usr/local/lib/../lib/libavcodec.a (found version "59.2.100") found components:  avcodec avdevice avutil avformat
-- Scripting: Luajit supported
-- Scripting: Python 3 supported
-- Using system Jansson library
-- XCB[XCB]: Found component XCB
-- Found XCB: /usr/lib/x86_64-linux-gnu/libxcb.so  found components:  XCB
-- Found Wayland: /usr/lib/x86_64-linux-gnu/libwayland-client.so;/usr/lib/x86_64-linux-gnu/libwayland-server.so;/usr/lib/x86_64-linux-gnu/libwayland-egl.so;/usr/lib/x86_64-linux-gnu/libwayland-cursor.so   
-- Found FFmpeg: /usr/local/lib/../lib/libavformat.a (found version "59.3.101") found components:  avformat avutil swscale swresample avcodec
-- Could NOT find XCB (missing: XCB_LIBRARIES XCB_INCLUDE_DIRS)
-- XCB[XCB]: Found component XCB
-- XCB[DRI2]: Found component DRI2
-- XCB[GLX]: Found component GLX
-- XCB[RANDR]: Found component RANDR
-- XCB[RENDER]: Found component RENDER
-- XCB[SHAPE]: Found component SHAPE
-- XCB[SHM]: Found component SHM
-- XCB[SYNC]: Found component SYNC
-- XCB[XFIXES]: Found component XFIXES
-- XCB[XINERAMA]: Found component XINERAMA
-- Found XCB: /usr/lib/x86_64-linux-gnu/libxcb.so;/usr/lib/x86_64-linux-gnu/libxcb-dri2.so;/usr/lib/x86_64-linux-gnu/libxcb-glx.so;/usr/lib/x86_64-linux-gnu/libxcb-randr.so;/usr/lib/x86_64-linux-gnu/libxcb-render.so;/usr/lib/x86_64-linux-gnu/libxcb-shape.so;/usr/lib/x86_64-linux-gnu/libxcb-shm.so;/usr/lib/x86_64-linux-gnu/libxcb-sync.so;/usr/lib/x86_64-linux-gnu/libxcb-xfixes.so;/usr/lib/x86_64-linux-gnu/libxcb-xinerama.so   
-- Found PulseAudio - Audio Monitor enabled
-- Using libavcodec for image loading in libobs
-- Found Wayland: /usr/lib/x86_64-linux-gnu/libwayland-client.so;/usr/lib/x86_64-linux-gnu/libwayland-server.so;/usr/lib/x86_64-linux-gnu/libwayland-egl.so;/usr/lib/x86_64-linux-gnu/libwayland-cursor.so  found components:  Client
-- XCB[XCB]: Found component XCB
-- XCB[RANDR]: Found component RANDR
-- XCB[SHM]: Found component SHM
-- XCB[XFIXES]: Found component XFIXES
-- XCB[XINERAMA]: Found component XINERAMA
-- Found XCB: /usr/lib/x86_64-linux-gnu/libxcb.so;/usr/lib/x86_64-linux-gnu/libxcb-randr.so;/usr/lib/x86_64-linux-gnu/libxcb-shm.so;/usr/lib/x86_64-linux-gnu/libxcb-xfixes.so;/usr/lib/x86_64-linux-gnu/libxcb-xinerama.so  found components:  XCB RANDR SHM XFIXES XINERAMA
-- Found jack: /usr/lib/x86_64-linux-gnu/libjack.so
-- Looking for Chromium Embedded Framework in /home/larzuk/App/cef_binary_4280_linux64
-- Using the bundled VST header.
-- Found FFmpeg: /usr/local/lib/../lib/libavcodec.a (found version "59.2.100") found components:  avcodec avfilter avdevice avutil swscale avformat swresample
-- Found FFmpeg: /usr/local/lib/../lib/libavcodec.a (found version "59.2.100") found components:  avcodec avutil avformat
-- Checking for module 'libftl'
--   No package 'libftl' found
-- Found ftl-sdk: ftl outputs enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/larzuk/App/obs-studio/build
I tryed about everything i found on the internet, but couldn't resolve the issue.

Is there a way to make this work?

Thanks, Tix.
 

Tuna

Member
It actually tells you what is wrong. Your custom compiled FFMPEG needs to be compiled with -fPIC flag. Else you cannot link the static FFMPEG library into ther shared libobs library.
 
Top