79095389

Date: 2024-10-16 18:36:48
Score: 1
Natty:
Report link

In some cases you may need to include the header inside the extern keyword. For example trying to use a C library like libpci inside a C++ program.

extern "C" {
#include <pci/pci.h>
}

Then you can link it against your C++ program like for example

g++ -std=c++11 -o testutils ../TestUtils.cpp -lpci -L/lib/x86_64-linux-gnu/

Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: David Fernandez