You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kali系统编译Ettercap插件报错:ec.h文件找不到求解决

Fixing the "fatal error: ec.h: No such file or directory" in Kali Linux

First off, you don't need to move your source code to a specific location—the issue has nothing to do with where your attack_test.c is stored. The problem is that GCC can't locate the ec.h header file when compiling. Let's break down the fixes step by step:

  • Step 1: Check if ec.h exists on your system
    Open a terminal and run this command to search for the header file across your system:

    find / -name ec.h 2>/dev/null
    
    • If no results appear: You're missing the library that provides ec.h. In Kali, this is almost always part of the OpenSSL development package. Install it with:

      sudo apt update && sudo apt install libssl-dev
      

      This package places ec.h in /usr/include/openssl/, a standard path GCC checks by default.

    • If results show up (e.g., /usr/include/openssl/ec.h): Either your code uses the wrong include statement, or GCC needs explicit instructions to find the file's directory.

  • Step 2: Fix the include statement or specify the path to GCC

    • If ec.h lives in /usr/include/openssl/, update your attack_test.c to use the full qualified include line:
      #include <openssl/ec.h>
      
    • If you don't want to modify the code, add the include directory to your compile command with the -I flag. For example, if ec.h is in /custom/path/include, your command becomes:
      gcc -shared -o attack_test.so -fPIC -I/custom/path/include attack_test.c
      
  • Step 3: Verify the fix
    After installing the package or adjusting the include path, re-run your original compile command. It should now locate ec.h without errors.

If you've made partial progress already (like installing some packages but still hitting snags), double-check that the include path is correctly specified or that the library version matches what your code expects. Some custom crypto library builds might place ec.h in non-standard locations, so the find command will help you pinpoint exactly where it's stored.

内容的提问来源于stack exchange,提问作者Aidan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 09:08:12