what libraries a program use during its compilation (Installation)

StackOverflow https://stackoverflow.com/questions/21898094

  •  13-10-2022
  •  | 
  •  

سؤال

I want to know about static libraries and dynamic libraries that a program use when it is going to install on a system. Basically I want to install qemu on my Linux system. I want to know what libs it use during configure and make ( compilation and running)

هل كانت مفيدة؟

المحلول

You can use ldd to list shared libraries needed by an executable. I don't have qemu installed at my system, but here is an example for ifconfig:

 $ ldd /sbin/ifconfig
linux-vdso.so.1 =>  (0x00007fff50ffe000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb960021000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb96040e000)

From here you can search the package containing files with the apt-file command:

$ apt-file search ld-linux-x86-64.so.2
libc6: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
libc6: /lib64/ld-linux-x86-64.so.2

Make sure you install the packages listed.

(FYI: ldd will also tell you which libraries are missing.)

نصائح أخرى

You can't. There's no such "tool", you may try to look into README if they provide it, this is also why you need to run "./configure" before running make, the configure script will check library dependencies for you before you run make. Just see inside configure script if you don't find the information in the README. Good luck.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top