./main: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory
时间: 2023-10-18 22:05:03 浏览: 143
当运行"./main"命令时,出现了错误"./main: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory"。这个错误说明在运行该程序时找不到名为"libevent-2.1.so.6"的共享库文件。这可能是因为该共享库文件不存在或者路径配置不正确。
根据引用和引用的信息,错误信息中提到的共享库文件"libevent-2.1.so.6"是缺失或无法打开的。这可能是由于库文件被删除、移动或者名称不一致等原因导致的。
根据引用的信息,一种解决方法是通过创建软连接来解决。你可以使用以下命令创建一个指向正确路径的软连接:
```shell
ln -s /usr/local/lib/libevent-2.1.so.7 /usr/lib64/libevent-2.1.so.6
```
这样,当程序在运行时,它将在/usr/lib64/libevent-2.1.so.6路径下找到所需的共享库文件。
请注意,你需要确保"/usr/local/lib/libevent-2.1.so.7"是存在的,并且与你的程序兼容。另外,你也可以检查你的路径配置是否正确,以确保程序能够找到正确的共享库文件。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [./test1: error while loading shared libraries: libevent-2.1.so.7: cannot open shared object file](https://blog.csdn.net/dongfanghe123/article/details/128917851)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [error while loading shared libraries: libstdc++.so.6:cannot open shared object file:](https://download.csdn.net/download/weixin_38719719/13698954)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Memcached 报错:/usr/local/bin/memcached: error while loading shared libraries: libevent-2.1.so.7](https://blog.csdn.net/VillianTsang/article/details/104931063)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文