执行python3 install.py --clangd-completer时,发生了错误,例如- Found Threads: TRUE -- Downloading libclang 16.0.1 from https://github.com/ycm-core/llvm/releases/download/16.0.1/libclang-16.0.1-x86_64-unknown-linux-gnu.tar.bz2 CMake Error at ycm/CMakeLists.txt:101 (file): file DOWNLOAD HASH mismatch for file: [/home/charims/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp/../clang_archives/libclang-16.0.1-x86_64-unknown-linux-gnu.tar.bz2] expected hash: [e0c69d229f6dd91d0530508fa28250f658cb27d7b8825394bf539f8cc1db8c9c] actual hash: [e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855] status: [56;"Failure when receiving data from the peer"] 如何解决
时间: 2024-01-27 14:06:09 浏览: 146
这个错误可能是由于下载的文件与预期的哈希值不匹配导致的。解决此问题的方法是手动下载 libclang 文件并将其放置在正确的位置。以下是一个可能的解决方案:
1. 在浏览器中打开以下链接:https://github.com/ycm-core/llvm/releases/download/16.0.1/libclang-16.0.1-x86_64-unknown-linux-gnu.tar.bz2
2. 手动下载文件,并确保下载的文件名为 `libclang-16.0.1-x86_64-unknown-linux-gnu.tar.bz2`。
3. 进入 `~/.vim/plugged/YouCompleteMe/third_party/ycmd/clang_archives` 目录。
4. 将手动下载的文件复制到该目录中。
5. 回到 `~/.vim/bundle/YouCompleteMe` 目录,并重新运行 `python3 install.py --clangd-completer` 命令。
此时,YouCompleteMe 应该能够正确安装并使用 libclang。
如果问题仍然存在,可能是由于网络问题导致下载文件失败。你可以尝试使用代理或者切换到一个稳定的网络连接来解决问题。另外,确保你的系统满足 YouCompleteMe 的要求,并且已经正确安装了 Python3 和 Clangd。
如果问题仍然存在,请参考 YouCompleteMe 的官方文档或者在相关的开源社区中寻求帮助,以获取更详细的解决方案。
相关问题
libclang-dev 已安装 但是QT 编译 仍然提示 WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation
如果 libclang-dev 已经安装,但是编译仍然提示找不到 libclang,可能是由于 libclang 的头文件或库文件路径没有被正确设置导致的。
你可以尝试在编译 Qt 时手动指定 libclang 的路径。假设 libclang 库文件的路径是 `/usr/lib/x86_64-linux-gnu/libclang.so`,头文件的路径是 `/usr/include/clang/`,则可以使用以下命令进行编译:
```
./configure -opensource -confirm-license -nomake examples -nomake tests -no-opengl -no-openssl -no-xcb -no-xkbcommon -no-icu -no-glib -no-pulseaudio -no-alsa -no-feature-geoservices_mapboxgl -no-feature-geoservices_mapbox -no-feature-geoservices_nokia -no-feature-geoservices_google -no-feature-geoservices_here -no-feature-geoservices_arcgis -no-feature-geoservices_ublox -no-feature-geoservices_maxar -no-feature-textodfwriter -no-feature-xmlpatterns -no-feature-testlib -no-feature-shared -no-feature-process -no-feature-printpreviewwidget -no-feature-printpreviewdialog -no-feature-printenginengeneric -no-feature-printsupport -no-feature-pdf -no-feature-paint_debug -no-feature-network -no-feature-mimetype -no-feature-journald -no-feature-jpeg -no-feature-ibus -no-feature-gif -no-feature-freetype -no-feature-fontconfig -no-feature-dbus -no-feature-cups -no-feature-cursor -no-feature-contextmenu -no-feature-completer -no-feature-commandlineparser -no-feature-codecs -no-feature-colornames -no-feature-colordialog -no-feature-colorpicker -no-feature-clipboard -no-feature-bearermanagement -no-feature-alsa -no-feature-accessibility -no-dbus-linked -no-compile-examples -no-openssl-linked -no-pch -system-zlib -system-libjpeg -system-libpng -system-freetype -system-harfbuzz -system-xcb -system-xkbcommon -no-gui -no-widgets -no-qml-debug -no-qml-debugger -no-compile-examples -no-libudev -no-feature-texthtmlparser -no-feature-textfreetype -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-texthtmlwriter -no-feature-textplaintextwriter -no-feature-textmarkdownreader -no-feature-sql-ibase -no-feature-sql-mysql -no-feature-sql-oci -no-feature-sql-odbc -no-feature-sql-psql -no-feature-sql-sqlite2 -no-feature-sql-sqlite -no-feature-sql-tds -no-feature-sqlite -no-feature-speex -no-feature-sse2 -no-feature-systemsemaphore -no-feature-systemsemaphore -no-feature-syslog -no-feature-tcpserver -no-feature-threads -no-feature-tiff -no-feature-toolbox -no-feature-unix-socket -no-feature-vnc -no-feature-wheelevent -no-feature-wizard -no-feature-xml -no-feature-xmlcatalog -no-feature-xmlstream -no-feature-xml -no-feature-xmlpatterns -no-feature-xmlrpc -no-feature-xcb-icccm -no-feature-xcb-image -no-feature-xcb-keysyms -no-feature-xcb-render -no-feature-xcb-shape -no-feature-xcb-xinput -no-feature-xinput2 -no-feature-xkb -no-feature-xrandr -no-feature-xrender -no-feature-xshm -no-feature-xsync -no-feature-xt -no-feature-ipv6ifname -no-feature-qt3d-logic -no-feature-qt3d-render -no-feature-qt3d-input -no-feature-qt3d-extras -no-feature-qt3d-animation -no-feature-qt3d-quick -no-feature-qt3d-simd -no-feature-qt3d-scene2d -no-feature-qt3d-scene3d -no-feature-qt3d-core -no-feature-qt3d-render -no-feature-qt3d-input -no-feature-qt3d-extras -no-feature-qt3d-animation -no-feature-qt3d-quick -no-feature-qt3d-simd -no-feature-qt3d-scene2d -no-feature-qt3d-scene3d -no-feature-qt3d-core -no-feature-qt3d -no-feature-qtvirtualkeyboard -no-feature-qtwayland -no-feature-qtmultimedia -no-feature-qtpurchasing -no-feature-qtsensors -no-feature-qtspeech -no-feature-qtvirtualkeyboard -no-feature-qtwayland -no-feature-qtmultimedia -no-feature-qtpurchasing -no-feature-qtsensors -no-feature-qtspeech -no-feature-qtwebchannel -no-feature-qtwebengine -no-feature-qtwebsockets -no-feature-qtwebview -no-feature-qtwebglplugin -no-feature-qtwebsockets -no-feature-qtwebview -no-feature-qtwebglplugin -no-feature-qtxmlpatterns -no-feature-qtx11extras -no-feature-qtxml -no-feature-qtxmlpatterns -no-feature-qtx11extras -no-feature-qtxml -no-feature-qtxmlpatterns -no-feature-qtx11extras -no-feature-qtxml -no-feature-qtxmlpatterns -no-feature-qtx11extras -no-feature-qtxml -feature-thread
make -j$(nproc) LLVM_INSTALL_DIR=/usr/include/clang/
```
其中,LLVM_INSTALL_DIR 指定了 libclang 的路径,这里设置为 `/usr/include/clang/`,请根据实际情况修改。
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2022-12-15T16:49:23.244+08:00", comments="Source Table: tm_daily_order_input_20221205") default List<TmDailyOrderInput> select(SelectDSLCompleter completer, TmDailyOrderInputDynamicSqlSupport.TmDailyOrderInput tmDailyOrderInput) { return MyBatis3Utils.selectList(this::selectMany, selectList, tmDailyOrderInput, completer); } 调用这个怎么写
这段代码看起来像是使用了 MyBatis Generator 自动生成的 Mapper 接口中的方法。如果你想使用这个方法来查询数据库中的数据,可以按照以下步骤来进行:
1. 确认你已经创建了对应的 Mapper 接口,并且已经将该 Mapper 注入到了 Spring 容器中。
2. 在你的 Java 代码中,通过 @Autowired 或者 @Resource 等注解来注入该 Mapper 接口的实例。
3. 调用该 Mapper 接口中的 select 方法,传入一个 SelectDSLCompleter 对象和一个 TmDailyOrderInput 对象。SelectDSLCompleter 对象可以使用 MyBatis 提供的 DSL 语法来构造查询条件,而 TmDailyOrderInput 对象则是作为查询条件的参数,用于指定你要查询的数据。
4. 最后,该方法会返回一个 List<TmDailyOrderInput> 对象,即查询结果。你可以对其进行进一步的处理或者直接返回给前端。
具体的代码实现方式可以参考以下示例:
```java
@Autowired
private TmDailyOrderInputMapper tmDailyOrderInputMapper;
public List<TmDailyOrderInput> selectByExample() {
TmDailyOrderInputDynamicSqlSupport.TmDailyOrderInput tmDailyOrderInput = TmDailyOrderInputDynamicSqlSupport.tmDailyOrderInput;
SelectDSLCompleter completer = select(tmDailyOrderInput.allColumns())
.from(tmDailyOrderInput)
.where(tmDailyOrderInput.orderId, isEqualTo("12345"))
.and(tmDailyOrderInput.orderDate, isGreaterThanOrEqualTo(LocalDate.now().minusDays(7)));
return tmDailyOrderInputMapper.select(completer, tmDailyOrderInput);
}
```
这是一个示例方法,使用了 MyBatis 提供的 DSL 语法来查询订单号为 "12345",且订单日期在最近一周内的所有数据。你可以根据自己的需求来构造不同的查询条件。
阅读全文