1

I am working on a large C/C++ development project, we are using Red Hat Enterprise Linux (RHEL) 6 for our development network, and also using g++ and gcc and also gmake.

Management directed us to install a virtual machine with Oracle VirtualBox with Red Hat CentOS Linux 6.10 so we can continue to do software development when our RHEL network is down for upgrades and/or maintenance. CentOS Linux and RHEL are supposed to be identical so our C/C++ applications should be able to be made and ran on either OS.

However, I encounter a strange issue when trying to make one of our applications on the CentOS Linux VM. it appears to not be able to find the following file which is included in a cpp file that is a composite part of the application.

/usr/include/pci/pci.h

The include statement is:

#include <pci/pci.h>

Doing a make the following error is generated:

/usr/bin/ld: cannot find -lpci

Doing a review of the C++ application, it actually has includes for two different pci.h files, like the following:

#include <pci/pci.h>
#include <linux/pci.h>

On our RHEL, where the error does not occur, the files for both of these includes are present, as well as some composite .h files:

/usr/include/pci/pci.h
/usr/include/linux/pci.h

On our CentOS Linux VM, the following folder and files are not present, but are present on our RHEL:

/usr/include/pci/pci.h
/usr/include/pci/config.h
/usr/include/pci/header.h
/usr/include/pci/types.h

The folder /usr/include/pci is not present on our CentOS Linux VM, Also, trying to install pciutils gives a message "already installed". The file /usr/include/linux/pci.h is on our CentOS Linux VM, and strangely, the lspci command also works on our CentOS Linux.

So trying various Google and Bing searches on this issue did not find much info. I think this is not actually a bug in the CentOS Linux, but is actually a configuration issue where the pci is left out on our CentOS Linux VM. Not exactly sure how to correct the issue. I think it might be a simple issue to resolve.

4
  • What is the output of yum whatprovides "/usr/include/pci/pci.h" on your CentOS system?
    – fpmurphy
    May 15, 2020 at 15:56
  • Hello, someone said I should install pciutils-devel, and that corrected the error when I installed it from an rpm, to answer your question the output is "pciutils-devel-3.1.10-4.el6.x86_64 : Linux PCI development library" May 15, 2020 at 17:43
  • And that is what the output of yum whatprovides "/usr/include/pci/pci.h" would have told you.
    – fpmurphy
    May 15, 2020 at 19:03
  • Just to let you know, your development platform, RHEL6, is ending active support later this year (November, 2020). You might want to consider something newer if this project has a timeline past then.
    – jsbillings
    May 15, 2020 at 21:49

1 Answer 1

1

You need to install pciutils-devel.

1
  • 1
    Thanks, that is exactly what I needed, YUM could not find it in any of the mirrors though, so I downloaded and installed the RPM file from centos.org, now the error is not occurring. May 15, 2020 at 17:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .