Ffmpeg library linking errors while compiling in Linux

Hi I am Rupesh from India and I have pc with i3 10th gen processor and asus prime h510 motherboard and I have installed open suse tumbleweed. I have tried to compile source code of ffmpeg but failed to do so.

First I have cloned ffmpeg from git and after that I have ran ./configure with options like --enable-opencl --enable-libva --enable-libmfx etc. After that I have ran the command "make -j7" and everything worked fine and at last I think that linking or loading failed.

I am providing the output of last few lines of the make command below

LD	ffmpeg_g
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
LD	ffprobe_g
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
STRIP	ffmpeg
STRIP	ffprobe

Try to suggest what is the meaning of the above errors and also how to compile source code of ffmpeg successfully.

Is there any need to reinstall gnu toolchain like gcc, g++, libstd, make, cmake, autoconf, automake etc.,. I think that main problem is linker or loader is not working properly.

I last question which is not related to current thread ie., "May I know where is the configuration files for gcc, make, auto conf". mostly configuration files are found in /etc but I can't find any file for gcc, make in /etc.

Regards,
Rupesh.

1 Like

Hello,

To me, this looks like your linker is picking up on 32-bit libraries when it is trying to link a project that was built against 64-bit libraries. That's a bit odd, and not something you'd ordinarily expect to happen these days. Can you share the exact sequence of commands you used to build this ?

1 Like

The commands I have used to compile ffmpeg are as below

 286  2022-03-13 20:43:56 cd ffmpeg/
  287  2022-03-13 20:44:07 ./configure --arch=x86_64 --prefix=/opt/ffmpeg --enable-gpl --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg --enable-libfdk-aac --enable-nonfree --enable-vaapi --enable-vdpau --enable-opencl --enable-opengl --enable-libmfx
  288  2022-03-13 20:45:12 export KCFLAGS="-march=native -pipe"
  289  2022-03-13 20:45:25 export KPPCFLAGS="-march=native -pipe"
  290  2022-03-13 20:45:48 make -j7

Previously while installing os from beginning packages related to obs like obs, osc were installed and before compiling ffmpeg I have removed them.

Is there any way to reconfigure gcc, make, cmake etc to compile ffmpeg normally.

As I have asked already where are the configuration files for gcc make, cmake present in my open suse tumbleweed Linux.

Hello,

OK, thanks. Addressing your question of where the "configuration files" are for gcc, make et al - these aren't packages that have a global configuration. The compiler, linker and other build utilities are (generally) told what to do by something called a Makefile, which is a file that provides the instructions for building a given software package. These days, build environments are so varied and complex that it would seldom be feasible to write that by hand.

That's the purpose of the configure script supplied with most source distributions of a package. It analyses your system, and (taking into account any specific arguments you provide, which will over-ride its own default choices) creates the makefiles necessary to build the package, leaving you with - theoretically, anyway - nothing left to do other than type make.

Now, returning to your particular problem - can I ask why you're going out of your way to specify an --arch flag to configure, and what the purpose here of the KCFLAGS and KPPCFLAGS variables is ? Normally you don't have to specify an architecture to build for unless you are specifically wanting to build the software package for a different architecture from the one you are using. And also (unless I'm mistaken) these two variables are solely used when building the kernel, and would have no effect when compiling ffmpeg (or anything else, for that matter).

When building something, it's a good idea to keep things as simple as possible. Only specify the options you actually need, and let configure and the compiler and linker figure out the rest. So in other words, I'd try this again, dropping the --arch flag from configure, and I'd also leave out those kernel KBuild-specific variables, and see if it then compiles successfully. If not, let us know if the same error remains (or what else is going wrong), and we can then take things from there.

Lastly: are you purely using the libraries, development utilities, and packages that came with your OS, or have you for some reason re-built some of these packages yourself from source prior to attempting to compile ffmpeg ? And if so, could you explain why that was done, and again outline the options you used when compiling and installing any other libraries and utilities that you have manually replaced ?

1 Like

Hi @rupeshforu3

One thing to also look at is your ENV vars related to gcc including:

COMPILER_PATH
LIBRARY_PATH
CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH

Give special attention to the LIBRARY_PATH ENV var.

If you want, just print out all your ENV vars with the env command and copy and paste them (using Markdown) in reply.

HTH

Reference:

As you said I have tried to compile ffmpeg in normal way ie., without any passing parameters like arch and the errors are less than previous.

As you said I am providing the output of env command. Unusual thing is I can't find entries for compiler_path, library_path etc.,.

Previously I have tried to install Trinity desktop environment packages from open suse tumbleweed repositories and failed to do as the package manager gave errors such as pinentry-tqt package is absent. So I have seen the Trinity desktop environment compilation help page and they have specified to compile packages tqt-qmake, Trinity cmake etc., and so I have tried to compiled tqt-qmake Trinity cmake but Trinity cmake failed to compile. After that I have aborted the job.

Yesterday I have uninstalled packages related to obs ie., Open build service and osc etc.,.

I think that due to the above gcc environment variables are deleted.

The output of various commands and it's output I am providing below.

ffmpeg configure command is

./configure --prefix=/opt/ffmpeg --enable-gpl --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg --enable-libfdk-aac --enable-nonfree --enable-vaapi --enable-vdpau --enable-opencl --enable-opengl --enable-libmfx

Make -j7 errors are

LD      ffprobe_g
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
STRIP   ffprobe
STRIP   ffmpeg
localhost:~/soft/temp/ffmpeg # 

Output from env command is

localhost:~ # env
SHELL=/bin/bash
SESSION_MANAGER=local/localhost.localdomain:@/tmp/.ICE-unix/1721,unix/localhost.localdomain:/tmp/.ICE-unix/1721
WINDOWID=1
COLORTERM=truecolor
SDK_HOME=/usr/lib64/jvm/java
XDG_CONFIG_DIRS=/root/.config/kdedefaults:/etc/xdg:/usr/etc/xdg
GDK_DPI_SCALE=1
LESS=-M -I -R
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
JDK_HOME=/usr/lib64/jvm/java
MACHTYPE=x86_64-suse-linux
GTK2_MODULES=unity-gtk-module
G_BROKEN_FILENAMES=1
HOSTNAME=localhost.localdomain
HISTSIZE=1000
LANGUAGE=
FROM_HEADER=
MINICOM=-c on
JAVA_ROOT=/usr/lib64/jvm/java
JAVA_HOME=/usr/lib64/jvm/java
AUDIODRIVER=pulseaudio
JRE_HOME=/usr/lib64/jvm/java/jre
XDG_DATA_HOME=/root/.local/share
CPU=x86_64
SHELL_SESSION_ID=a98a383be9d64ea6872d1d2924342432
XDG_CONFIG_HOME=/root/.config
JAVA_BINDIR=/usr/lib64/jvm/java/bin
LIBVA_DRIVER_NAME=iHD
DESKTOP_SESSION=/usr/share/wayland-sessions/plasmawayland
GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc:/root/.config/gtkrc
XCURSOR_SIZE=24
GPG_TTY=/dev/pts/1
XDG_SEAT=seat0
PWD=/root
QEMU_AUDIO_DRV=pa
XDG_SESSION_DESKTOP=KDE
LOGNAME=root
XDG_SESSION_TYPE=wayland
MANPATH=/usr/share/man:/usr/local/man:/usr/local/share/man
SYSTEMD_EXEC_PID=1601
XAUTHORITY=/run/user/0/xauth_vfyldC
LS_OPTIONS=-A -N --color=tty -T 0
XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/root/.gtkrc-2.0:/root/.config/gtkrc-2.0
XNLSPATH=/usr/share/X11/nls
HOME=/root
LANG=POSIX
LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.xz=00;31:*.avi=01;35:*.bmp=01;35:*.dl=01;35:*.fli=01;35:*.gif=01;35:*.gl=01;35:*.jpg=01;35:*.jpeg=01;35:*.mkv=01;35:*.mng=01;35:*.mov=01;35:*.mp4=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.svg=01;35:*.tga=01;35:*.tif=01;35:*.webm=01;35:*.webp=01;35:*.wmv=01;35:*.xbm=01;35:*.xcf=01;35:*.xpm=01;35:*.aiff=00;32:*.ape=00;32:*.au=00;32:*.flac=00;32:*.m4a=00;32:*.mid=00;32:*.mp3=00;32:*.mpc=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:*.wma=00;32:*.wv=00;32:
XDG_CURRENT_DESKTOP=KDE
KONSOLE_DBUS_SERVICE=:1.92
PYTHONSTARTUP=/etc/pythonstart
WAYLAND_DISPLAY=wayland-0
KONSOLE_DBUS_SESSION=/Sessions/1
PROFILEHOME=
OSTYPE=linux
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
LESS_ADVANCED_PREPROCESSOR=no
KONSOLE_VERSION=211203
KDE_SESSION_UID=0
XDG_CACHE_HOME=/root/.cache
XKB_DEFAULT_LAYOUT=us
XDG_ACTIVATION_TOKEN=localhost.localdomain;1647251025;868404;1730_TIME0
LESSCLOSE=lessclose.sh %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
HOST=localhost.localdomain
XAUTHLOCALHOSTNAME=localhost.localdomain
LESSOPEN=lessopen.sh %s
USER=root
COLORFGBG=15;0
PLASMA_USE_QT_SCALING=1
KDE_SESSION_VERSION=5
MORE=-sl
QT_WAYLAND_FORCE_DPI=96
CSHEDIT=emacs
DISPLAY=:1
SHLVL=1
WINDOWMANAGER=/usr/bin/startplasma-x11
PAGER=less
CVS_RSH=ssh
XDG_VTNR=2
UBUNTU_MENUPROXY=1
XDG_SESSION_ID=2
LC_CTYPE=en_US.UTF-8
XDG_RUNTIME_DIR=/run/user/0
DEBUGINFOD_URLS=https://debuginfod.opensuse.org/ 
QT_AUTO_SCREEN_SCALE_FACTOR=0
MANPATHISSET=yes
XCURSOR_THEME=breeze_cursors
GTK3_MODULES=unity-gtk-module
XDG_DATA_DIRS=/root/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/share:/var/lib/snapd/desktop
KDE_FULL_SESSION=true
CONFIG_SITE=/usr/share/site/x86_64-unknown-linux-gnu
PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/snap/bin
GDK_SCALE=1
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
PROFILEREAD=true
KDE_APPLICATIONS_AS_SCOPE=1
MAIL=/var/spool/mail/root
HOSTTYPE=x86_64
LESSKEY=/usr/etc/lesskey.bin
KONSOLE_DBUS_WINDOW=/Windows/1
BASH_FUNC_mc%%=() {  . /usr/share/mc/mc-wrapper.sh
}
OLDPWD=/root/soft/temp/ffmpeg
_=/usr/bin/env

Try to suggest how to set environment variables for gcc which is specific to my x86_64 pc and compile ffmpeg normally.

Hi @rupeshforu3,

please post the output of

$ file -L /usr/lib/libm.so
$ gcc -lm foo.c && ldd ./a.out

with foo.c:

#include <math.h>
int main() { return sqrt(0); }
2 Likes

As you said I am providing the output as follows


localhost:~/soft/programs # cat foo.c 
#include <math.h>

int main()
{
 return sqrt(0);
}

localhost:~/soft/programs # file -L /usr/lib/libm.so
/usr/lib/libm.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=1cc017e48bc506610ed259265555ccda053b1929, for GNU/Linux 3.2.0, not stripped
localhost:~/soft/programs # gcc -lm foo.c && ldd ./a.out
        linux-vdso.so.1 (0x00007fffb7339000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fa117024000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fa116df5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fa117135000)
localhost:~/soft/programs # 
1 Like

Take a look at the gcc option -m32 and see how far that gets you @rupeshforu3

You can also try:

export CFLAGS=-m32

... before you make

Hopefully , you get the idea ....

thanks @rupeshforu3 for the output. Two things stand out:
a) /usr/lib/libm.so is 32bit, so the linker failed with skipping incompatible ... on your 64bit system.
b) foo.c is compiled and linked successfully against the 64bit lib /lib64/libm.so.6.

Where does /usr/lib/libm.so come from? Do you have multiarch support enabled on your system?

Environment variables for gcc are missing and so how to recreate.

Does the issue gets resolved if I uninstall complete build tools like gcc g++ and auto tools etc., and reinstall them.

Hello,

I don't think missing environment variables are the problem here. As was previously mentioned, the configure script would figure out what it thinks your build environment is like. The problem is, it is picking up on 32-bit libraries somewhere, and they are taking precedence over your 64-bit ones. Because you are running in 64-bit mode (which is what you'd expect these days), this then causes problems at link time.

Can you check /etc/ld.so.conf for us, and post its contents here ? Most likely all it does is include the contents of /etc/ld.so.conf.d or its equivalent, and so it may be an idea to post the contents of anything in there as well. Something, somewhere, is making your system pick up on 32-bit libraries first ahead of its own native 64-bit libraries, and that is most likely the cause of your compilation problems here.

Hi @rupeshforu3,

Perhaps you should adjust your thinking about bit and try to understand what is the problem.

ENV vars for gcc are, generally speaking, just convenient ways to specify the same data (configuration flags) across the scope of the user or system which can be added to gcc or ldd commands, makefiles, etc.

It seems obvious to our team that you have a problem related to mixing and matching 32 bit code with 64 bit code.

The good news is that you can compile 64 bit code to work with 32 bit code, etc. You can even get things to work together; but it requires knowledge of your system.

It seems you (or someone) has misconfigured gcc in a number of ways.

As @bendingrodiguez suggested, if I were you I would determine if your gcc configuration is configured to compile both 32 and 64 bit code.

Hence, his question was valid and I expected you to respond to that question, but you might have missed it:

I'm not sure how you got yourself into this situation; but it it not unusual for people to get themselves in a kind of a "mess" trying to force things like this to work installing libs here and there. No amount of guessing and stabbing in the dark on our end will solve this for you; because we don't have knowledge of what you have done and what you have not done. This is why it is important to answer our moderators questions, like this one:

Can you compile and something simple like hello_world.c with both gcc flags -m32 and -m64 or not?

It should take you less than 5 minutes, even as a novice, to test and reply.

Thanks.

This "something" is more than likely a missing or incorrect gcc -L flag (or flags), makefile directive(s), or a missing ENV variable which specifies the system / user wide directory for where the linker should search for libs and in what order.

Maybe try this @rupeshforu3 ...

 sudo apt-get install gcc-multilib

Then:

cat hello.c

#include <stdio.h>
int main() {
   // printf() displays the string inside quotation
   printf("Hello, World!\n");
   return 0;
}

64 bit

gcc -m64 hello.c
file a.out
a.out: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=991db39efba8f0f2985e8106fef4751ef16ef1b8, not stripped

32 bit

gcc -m32 hello.c
file a.out
a.out: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=7d206f25d53b5ec39f8724f24d1bbaf7ab78aa55, not stripped

You can see, as @bendingrodriguez asked you about earlier, @rupeshforu3 , that if you have installed gcc-multilib you can compile with both the -m64 and the -m32 gcc flags.

OBTW:

gcc -m64 hello.c
 ./a.out
Hello, World!

gcc -m32 hello.c
./a.out
Hello, World!

Try it @rupeshforu3 If your system somehow is gummed up with 32 bit libs, you might get lucky if you just try to compile your program as a 32 bit executable.

Or you can go to a linux box which is not all "gummed up" and compile as 64 bit and copy the binary over.

Or you can make sure you have the 64 bit dev environment installed and instruct your linker to link to those libs :slight_smile:

Either way, there is no need for "guess work". Just do it :slight_smile:

HTH

2 Likes

FWIW, I thought I would see how easy it normally is to install ffmpeg on linux ubuntu.

So I did this:

ubuntu$ sudo apt install ffmpeg

and answered Y if I wanted to install and everything went fine, so I typed:

ubuntu$ condor2769:/tmp# ffmpeg 
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

FYI, also

ubuntu$ cd /usr/bin
ubuntu$:/usr/bin# file ffmpeg
ffmpeg: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=6d854458d186b97036b71e06d6fa4e3126dd6781, stripped

Normal install using apt on ubuntu went fine.

You can see that on ubuntu linux, the install is smooth and works as expected.

2 Likes

Also note, @rupeshforu3

If you compare your make options:

--prefix=/opt/ffmpeg --enable-gpl --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg --enable-libfdk-aac --enable-nonfree --enable-vaapi --enable-vdpau --enable-opencl --enable-opengl --enable-libmfx

with the ubuntu linux distro make options.

--prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared

You can quickly see that your original make configuration @rupeshforu3 is missing a link to the --libdir=/usr/lib/x86_64-linux-gnu (of course, your absolute path might be different).

Pardon me, I'm really not trying to be difficult, but this is a relatively easy problem to solve it you just take a step back and think about what you are trying to do and why.

It's not necessary to guess or stab at the problem in the dark. There are myriad ways to solve your problem, if you would only take a moment to understand what you are actually doing.

You @rupeshforu3 have no reference to link the 64 bit libs required (see the ubuntu linux distro config) in your setup.

You don't need some old, very tech-savvy guy like me to point this out to you @rupeshforu3 if you just take a moment to think about what your problem is and why. It's not my problem, but I can get ffmpeg to work on linux effortlessly.

You can do it also @rupeshforu3 but you have still refused to even tell us the exact operating system you are using (the linux distro and version). How can you solve computer related problems if you do not even take the time (5 seconds) to inform our team the OS and version you are using?

1 Like

1000% agree with neo. And I'll also ask what you're really trying to do? Why bother to compile what's already there? ffmpeg already supports that codec and you can shove them onto your system by installing the packages. What actual problem/feature are you trying to get?

And weren't you using Arch over here, where you posted the same question?
https://www.linux.org/threads/errors-in-aom-and-aom-git-aur-packages-arch-linux.43655/#post-182251

And working on this last year?