I’m trying to run a C program, but every time I try to run it I get this message:

error while loading shared libraries: libpcap.so.0.8: cannot open shared object file: No such file or directory

I've re-installed libpcap; I've installed gcc and g++; I’ve updated it and I’m lost. I’m not sure what else I can do. Could anyone help out?

  • What is the output of sudo yum provides '*/libpcap.so*' ? – Red Cricket Feb 28 '15 at 1:24
  • pastebin.com/iXSWYcrg is the output – Adam Feb 28 '15 at 2:07
  • 1
    Looks like you have the libs for libpcap-1.4. Do you have the source for your c program? Looks like you will need to recompile and link it. – Red Cricket Feb 28 '15 at 3:31

It appears that compiling this:

gcc -o example example.c -l:libpcap.so.1.7.4

still requires that


be on your system.

And I have no idea why. However, making a link from (whatever version you're using, notice I'm EXPLICITLY telling it to link to libpcap.so.1.7.4) whatever version you do have to libpcap.so.0.8 - it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.