Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems compiling with npcap #485

Open
MickaMickaMicka opened this issue Aug 23, 2022 · 1 comment
Open

problems compiling with npcap #485

MickaMickaMicka opened this issue Aug 23, 2022 · 1 comment

Comments

@MickaMickaMicka
Copy link

I am failing to compile libtins with npcap sdk 1.13 with visual studio 2019 compiler and I dont know whether I am doing it right.
I have pthreads as a library in my local development environment. It looks as if it is needed by pcap but isn't found by CMake.

I set

PCAP_INCLUDE_DIR to C:/localpath/npcap-sdk-1.13/Include
PCAP_LIBRARY to C:/localpath/npcap-sdk-1.13/Lib/x86/wpcap.lib
PCAP_ROOT_DIR to C:/localpath/npcap-sdk-1.13

and I am getting that output:

Found PCAP: C:/localpath/npcap-sdk-1.13/lib/x86/wpcap.lib
Performing Test PCAP_LINKS_SOLO
Performing Test PCAP_LINKS_SOLO - Failed
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
Performing Test PCAP_NEEDS_THREADS
Performing Test PCAP_NEEDS_THREADS - Failed
CMake Error at cmake/Modules/FindPCAP.cmake:70 (message):
Couldn't determine how to link against libpcap
Call Stack (most recent call first):
CMakeLists.txt:61 (FIND_PACKAGE)

Configuring incomplete, errors occurred!
See also "C:/localpath/libtins-4.4_solution/CMakeFiles/CMakeOutput.log".
See also "C:/localpath/libtins-4.4_solution/CMakeFiles/CMakeError.log".

Error message in CMakeError that pthread.h couldnt be opened. That's clear because CMake doesn know where to search for it...

Is there any solution? How can I tell CMake or libtins where to search for pthread?

@rectified95
Copy link

rectified95 commented Aug 30, 2022

This StackOverflow post contains a long answer that worked for me on Windows. (I built with VS 2022 though and didn't have any pthreads issues. Still it shows how to add inlcude paths which is likely what you need)
https://stackoverflow.com/questions/60841031/libtins-sniffer-undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants