-1
OS:Debian9 Linux4.4 
Hardware:ARMv9

How do i know which libs is a header file in /usr/include/ belongs to?

for example, there is an error when I build camera-app-gstreamer:

camera-app-gstreamer/xcore'
drm_display.h:30:17: fatal error: drm.h: No such file or directory
 #include <drm.h>**

I fixed it by apt install libdrm-dev, after installing libdrm-dev, header files named drm.h, drm*.h appears in /usr/include.

now, I have Make problem , it shows:

conftest.c:29:41: fatal error: linux/atomisp.h: No such file or directory
#include <linux/atomisp.h> 

and how can I find which lib it belongs to ?

Thank you.

Mojtaba Ahmadi
  • 1,044
  • 19
  • 38
Younix
  • 3
  • 1
  • as you're using ARM and the filename is atomisp.h, I would try searching the hardware vendors site. Good luck! – shellter Jan 03 '18 at 15:54

2 Answers2

2

In case you know the complete path to the file and in case it is installed (maybe on a computer where it works), you can go with this dpkg cheat sheet to find out which package installs it:

  • dpkg-query -W <pattern> — list locally known packages matching given pattern
  • dpkg-query -l — list all locally known packages
  • dpkg -i <packagefile> — install the package in the given file
  • dpkg -r <package> — remove the given package
  • dpkg -S /path/to/file — show the package which installed the given file

If you want to find out whether a file is installed on a system, you can use the locate tools.

If you want to find out which package will install it, you should install the apt-file tools and use them:

sudo apt-get install apt-file
sudo apt-file update  # will take a while but needs not to be repeated often
apt-file search drm.h

This will list the packages your package management system knows which contain a file with this as part of the name. You can append | grep '/drm.h$' to find only the ones which have exactly this file.

Alfe
  • 56,346
  • 20
  • 107
  • 159
0

Use the package content search of your distribution, in this case you can find it here.

If you cannot find the filename through that search, it means there is no debian package providing it.

ypnos
  • 50,202
  • 14
  • 95
  • 141