0

I'm trying to add pcap functions into my C++ project in Clion on linux.

My h file contains:

#include <pcap/pcap.h> 

And the CMAKE file was updated as well.

Instead of using the next command:

if (NOT MSVC)
    target_link_libraries(${TARGET} pthread)
endif()

it is now:

if (NOT MSVC)
    target_link_libraries(${TARGET} pthread pcap)
endif()

still getting the next errors:

undefined reference to "pcap_open_dead"
undefined reference to "pcap_dump_open"
undefined reference to "pcap_dump_close"
undefined reference to "pcap_close"

Anyone knows how to solve it?

Thanks

Erez Fridman
  • 119
  • 1
  • 12

1 Answers1

1

Thanks for the help!

After using the VERBOSE flag I was able to see the problem.

I added the pcap flag in another CMAKE file and now it works :)

Erez Fridman
  • 119
  • 1
  • 12