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

安装旧版Tor时libevent C头文件找不到的问题求助

Fixing Libevent Header File Not Found Error for Old Tor Version

Got it, let's break down why this error is happening and get your Tor build working smoothly.

The Root Cause

When you run ./configure --with-libevent-dir=/libevent/lib/x86_64-linux-gnu/, you're pointing the configure script directly to the library subdirectory—but it still needs access to the header files, which live in the include folder at the top level of your libevent directory. Most older configure scripts expect --with-libevent-dir to point to the parent folder containing both include/ and lib/ subdirectories, not just the lib subfolder.

Step-by-Step Solutions

1. Point to the Top-Level Libevent Directory

Update your configure command to target the root of your libevent folder (the one containing include/, lib/, and share/). For example, if your libevent folder is in your current working directory, run:

./configure --with-libevent-dir=./libevent/

This lets the configure script automatically locate both the header files (in ./libevent/include/) and libraries (in ./libevent/lib/x86_64-linux-gnu/) without extra flags.

2. Explicitly Separate Include and Library Paths

If the first method doesn't work (some older configure scripts are stricter about path parsing), you can specify the header and library paths separately to remove ambiguity:

./configure --with-libevent-include=./libevent/include/ --with-libevent-lib=./libevent/lib/x86_64-linux-gnu/

This directly tells the script exactly where to look for the required headers and compiled libraries.

3. Verify Critical Header Files

From your directory structure, I can see event2/event-config.h exists—this is a key file that old Tor versions depend on. Since this file is present, the above commands should resolve the "header files not found" error once you use the correct paths.


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.11 07:34:53