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

Failing To Install on Windows 10 With Error lld-link: error: could not open 'wpcap.lib': no such file or directory #1

Closed
ShabbirHasan1 opened this issue Sep 12, 2022 · 4 comments
Labels
missing dependency Problem related to an external required dependency Windows Something related to Windows operating system

Comments

@ShabbirHasan1
Copy link

Issue Description
Failing To Install on Windows 10 With Error lld-link: error: could not open 'wpcap.lib': no such file or directory

To Reproduce
Steps to reproduce the bug, e.g.:

  1. Opened Windows Terminal / Shell
  2. Write cargo install sniffnet and press enter
  3. At The Final Compilation Step
  4. An Error Occur lld-link: error: could not open 'wpcap.lib': no such file or directory

Expected Behavior
sniffnet installed successfully

Screenshots / Shell Output

 cargo install sniffnet
    Updating crates.io index
  Installing sniffnet v0.4.0
    Updating crates.io index
   Compiling winapi v0.3.9
   Compiling proc-macro2 v1.0.43
   Compiling quote v1.0.21
   Compiling unicode-ident v1.0.3
   Compiling syn v1.0.99
   Compiling autocfg v1.1.0
   Compiling ucd-trie v0.1.5
   Compiling cfg-if v1.0.0
   Compiling version_check v0.9.4
   Compiling libc v0.2.132
   Compiling bitflags v1.3.2
   Compiling memchr v2.5.0
   Compiling crc32fast v1.3.2
   Compiling adler v1.0.2
   Compiling log v0.4.17
   Compiling lazy_static v1.4.0
   Compiling color_quant v1.1.0
   Compiling windows_x86_64_msvc v0.36.1
   Compiling byteorder v1.4.3
   Compiling regex-syntax v0.6.27
   Compiling weezl v0.1.7
   Compiling font-kit v0.11.0
   Compiling bytemuck v1.12.1
   Compiling jpeg-decoder v0.2.6
   Compiling plotters-backend v0.3.4
   Compiling os_str_bytes v6.3.0
   Compiling float-ord v0.2.0
   Compiling heck v0.4.0
   Compiling hashbrown v0.12.3
   Compiling textwrap v0.15.0
   Compiling once_cell v1.14.0
   Compiling ttf-parser v0.15.2
   Compiling arrayvec v0.7.2
   Compiling strsim v0.10.0
   Compiling thousands v0.2.0
   Compiling num-traits v0.2.15
   Compiling num-integer v0.1.45
   Compiling num-rational v0.4.1
   Compiling indexmap v1.9.1
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling miniz_oxide v0.5.4
   Compiling gif v0.11.4
   Compiling plotters-svg v0.3.3
   Compiling clap_lex v0.2.4
   Compiling etherparse v0.12.0
   Compiling flate2 v1.0.24
   Compiling aho-corasick v0.7.19
   Compiling windows-sys v0.36.1
   Compiling libloading v0.6.7
   Compiling winapi-util v0.1.5
   Compiling wio v0.2.2
   Compiling iana-time-zone v0.1.47
   Compiling atty v0.2.14
   Compiling time v0.1.44
   Compiling crossterm_winapi v0.4.0
   Compiling errno v0.2.8
   Compiling png v0.17.6
   Compiling regex v1.6.0
   Compiling same-file v1.0.6
   Compiling termcolor v1.1.3
   Compiling thiserror-impl v1.0.34
   Compiling dwrote v0.11.0
   Compiling colored v2.0.0
   Compiling crossterm v0.13.3
   Compiling chrono v0.4.22
   Compiling pcap v0.10.1
   Compiling walkdir v2.3.2
   Compiling clap_derive v3.2.18
   Compiling thiserror v1.0.34
   Compiling image v0.24.3
   Compiling pest v2.3.0
   Compiling clap v3.2.20
   Compiling semver-parser v0.10.2
   Compiling plotters-bitmap v0.3.2
   Compiling semver v0.11.0
   Compiling rustc_version v0.3.3
   Compiling pathfinder_simd v0.5.1
   Compiling pathfinder_geometry v0.5.1
   Compiling plotters v0.3.4
   Compiling sniffnet v0.4.0
error: linking with `lld-link` failed: exit code: 1
  |
  = note: "lld-link" "/NOLOGO" "C:\\Users\\DRJUNE~1\\AppData\\Local\\Temp\\rustc7JAQIh\\symbols.o" "C:\\Users\\DRJUNE~1\\AppData\\Local\\Temp\\cargo-installfyHKzO\\release\\deps\\sniffnet-fa3dbf1e9f7dad19.sniffnet.7e7680a5-cgu.3.rcgu.o" "/LIBPATH:C:\\Users\\DRJUNE~1\\AppData\\Local\\Temp\\cargo-installfyHKzO\\release\\deps" "/LIBPATH:C:\\Users\\DrJuneMoone\\.cargo\\registry\\src\\index.crates.io-e139d0d48fed7772\\windows_x86_64_msvc-0.36.1\\lib" "/LIBPATH:C:\\Users\\DrJuneMoone\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\DrJuneMoone\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-7738daf2e99ec4b2.rlib" "wpcap.lib" "legacy_stdio_definitions.lib" "windows.lib" "advapi32.lib" "cfgmgr32.lib" "d2d1.lib" "dwrite.lib" "dxgi.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "ole32.lib" "opengl32.lib" "runtimeobject.lib" "user32.lib" "windowscodecs.lib" "winspool.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "libcmt.lib" "legacy_stdio_definitions.lib" "/NXCOMPAT" "/LIBPATH:C:\\Users\\DrJuneMoone\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "/OUT:C:\\Users\\DRJUNE~1\\AppData\\Local\\Temp\\cargo-installfyHKzO\\release\\deps\\sniffnet-fa3dbf1e9f7dad19.exe" "/OPT:REF,ICF" "/DEBUG:NONE"
  = note: lld-link: error: could not open 'wpcap.lib': no such file or directory


error: could not compile `sniffnet` due to previous error
error: failed to compile `sniffnet v0.4.0`, intermediate artifacts can be found at `C:\Users\DRJUNE~1\AppData\Local\Temp\cargo-installfyHKzO`

Desktop (please complete the following information):

  • OS: Windows 10
  • Rust 1.65 nightly-x86_64-pc-windows-msvc
@GyulyVGC
Copy link
Owner

GyulyVGC commented Sep 12, 2022

It is a known problem. Did you tried following what's suggested in the README? Section Install and Run -> Windows dependencies

You need to:

  • Install Npcap.

  • Download the Npcap SDK.

  • Add the SDK's /Lib or /Lib/x64 folder to your LIB environment variable.

If you don't have a LIB environment variable first create it and then add the aforementioned folder to it.

Let me know if you manage to fix the problem.

@ShabbirHasan1
Copy link
Author

It is a known problem. Did you tried following what's suggested in the README? Section error condition -> windows configuration problems.

You need to:

  • Install Npcap.
  • Download the Npcap SDK.
  • Add the SDK's /Lib or /Lib/x64 folder to your LIB environment variable.

If you don't have a LIB environment variable first create it and then add the aforementioned folder to it.

Let me know if you manage to fix the problem.

Thank You For The Prompt Response.

Following the suggestion, I have managed to install the package successfully. Thanks for creating this amazing app.

Shell Output

   Compiling sniffnet v0.4.0
    Finished release [optimized] target(s) in 3m 52s
  Installing C:\Users\DRJUNE~\.cargo\bin\sniffnet.exe
   Installed package `sniffnet v0.4.0` (executable `sniffnet.exe`)

@han1548772930
Copy link

han1548772930 commented Aug 3, 2023

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwpcap: No such file or directory
collect2.exe: error: ld returned 1 exit status.

My operating system is window11.
why mine is lwpcap.
what should I do.

@GyulyVGC
Copy link
Owner

GyulyVGC commented Aug 3, 2023

My operating system is window11. why mine is lwpcap. what should I do.

The same steps above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing dependency Problem related to an external required dependency Windows Something related to Windows operating system
Projects
None yet
Development

No branches or pull requests

3 participants