ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.41k stars 2.8k forks source link

CMake Error,no libclang found #2756

Closed zllfdd closed 7 years ago

zllfdd commented 7 years ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key questions:

CMake Error at ycm/CMakeLists.txt:336 (message): Using Clang completer, but no libclang found. Try setting EXTERNAL_LIBCLANG_PATH or revise your configuration

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 12 2016 18:25:27) MS-Windows 32 位图形界面版本 带 OLE 支持 包含补丁: 1-2 编译者 mool@tororo 巨型版本 带图形界面。 可使用(+)与不可使用(-)的功能: +acl +eval +mouse +syntax +arabic +ex_extra +mouseshape +tag_binary +autocmd +extra_search +multi_byte_ime/dyn +tag_old_static +balloon_eval +farsi +multi_lang -tag_any_white +browse +file_in_path -mzscheme +tcl/dyn ++builtin_terms +find_in_path +netbeans_intg -termguicolors +byte_offset +float +num64 -tgetent +channel +folding +ole -termresponse +cindent -footer +packages +textobjects +clientserver +gettext/dyn +path_extra +timers +clipboard -hangul_input +perl/dyn +title +cmdline_compl +iconv/dyn +persistent_undo +toolbar +cmdline_hist +insert_expand -postscript +user_commands +cmdline_info +job +printer +vertsplit +comments +jumplist +profile +virtualedit +conceal +keymap +python/dyn +visual +cryptv +lambda +python3/dyn +visualextra +cscope +langmap +quickfix +viminfo +cursorbind +libcall +reltime +vreplace +cursorshape +linebreak +rightleft +wildignore +dialog_con_gui +lispindent +ruby/dyn +wildmenu +diff +listcmds +scrollbind +windows +digraphs +localmap +signs +writebackup +directx -lua +smartindent -xfontset -dnd +menu +startuptime -xim -ebcdic +mksession +statusline +xpm_w32 +emacs_tags +modify_fname -sun_workshop -xterm_save 系统 vimrc 文件: "$VIM\vimrc" 用户 vimrc 文件: "$HOME_vimrc" 第二用户 vimrc 文件: "$HOME\vimfiles\vimrc" 第三用户 vimrc 文件: "$VIM_vimrc" 用户 exrc 文件: "$HOME_exrc" 第二用户 exrc 文件: "$VIM_exrc" 系统 gvimrc 文件: "$VIM\gvimrc" 用户 gvimrc 文件: "$HOME_gvimrc" 第二用户 gvimrc 文件: "$HOME\vimfiles\gvimrc" 第三用户 gvimrc 文件: "$VIM_gvimrc" defaults file: "$VIMRUNTIME\defaults.vim" 系统菜单文件: "$VIMRUNTIME\menu.vim" 编译方式: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL -DFEAT_XPM_W32 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /Fo.\ObjGXOLYHTRi386/ /Ox /GL -DNDEBUG /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_GUI_W32 -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86 .dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL =\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python35.dl l\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl524.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=22 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby220.dll\" -DFEAT_HUGE /Fd.\ObjGXOLYHTRi386/ /Zi 链接方式: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:i386 gdi32.lib version.lib
winspool.lib comctl32.lib advapi32.lib shell32.lib /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib user32.lib /nodefaultlib:python27.lib /nodefaultlib:python35.lib "E:\tcl\lib\tclstub86.lib" WSock32.lib xpm\x86\lib\libXpm.lib /PDB:gvim.pdb -debug

Output of YcmDebugInfo

Contents of YCM, ycmd and completion engine logfiles

OS version, distribution, etc.

Windows: Win10 1073 (Microsoft Windows [版本 10.0.15063]) 7zip: 16.02

Output of build/install commands

Searching Python 3.5 libraries... Found Python library: C:\Users\lks\AppData\Local\Programs\Python\Python35-32\libs\python35.lib Found Python headers folder: C:\Users\lks\AppData\Local\Programs\Python\Python35-32\include -- The C compiler identification is MSVC 19.10.25017.0 -- The CXX compiler identification is MSVC 19.10.25017.0 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonLibs: C:/Users/lks/AppData/Local/Programs/Python/Python35-32/libs/python35.lib (found suitable version "3.5.2", minimum required is "3.3") Using Clang archive: C:/Users/lks/vimfiles/bundle/YouCompleteMe/third_party/ycmd/cpp/../clang_archives/LLVM-4.0.1-win32.exe Using libclang to provide semantic completion for C/C++/ObjC CMake Error at ycm/CMakeLists.txt:336 (message): Using Clang completer, but no libclang found. Try setting EXTERNAL_LIBCLANG_PATH or revise your configuration

-- Configuring incomplete, errors occurred! See also "C:/Users/lks/AppData/Local/Temp/ycm_build_e3bejygq/CMakeFiles/CMakeOutput.log". ERROR: the build failed.

NOTE: it is highly unlikely that this is a bug but rather that this is a problem with the configuration of your system or a missing dependency. Please carefully read CONTRIBUTING.md and if you're sure that it is a bug, please raise an issue on the issue tracker, including the entire output of this script and the invocation line used to run it.

zllfdd commented 7 years ago

commit 369fdade93adf23ef3da3b5f8e9fcd14a2b3f093

micbou commented 7 years ago

Thanks for the report. When manually extracting the LLVM-4.0.1-win32.exe installer with 7-Zip 16.02:

7z.exe x LLVM-4.0.1-win32.exe

I obtain the following folders in the current directory:

'$PLUGINSDIR'
bin
include
lib
libexec
msbuild-bin
share
tools

with libclang.lib in the lib folder. Could you tell us which folders you are obtaining in your case?

micbou commented 7 years ago

And where the libclang.lib file can be found?

zllfdd commented 7 years ago

7z x LLVM-4.0.1-win32.exe

7-Zip 9.10 beta Copyright (c) 1999-2009 Igor Pavlov 2009-12-22

Processing archive: LLVM-4.0.1-win32.exe

Extracting 殌\InstallOptions.dll Extracting 殌\StartMenu.dll Extracting 殌\ioSpecial.ini Extracting 殌\modern-wizard.bmp Extracting 殌\modern-header.bmp Extracting \\殌\NSIS.InstallOptions.ini Extracting 焵\bin\LTO.dll Extracting 焵\bin\clang++.exe Extracting 焵\bin\clang-apply-replacements.exe Extracting 焵\bin\clang-change-namespace.exe ...

dir 2017/08/26 15:11

. 2017/08/26 15:11 .. 2017/08/06 21:32 95,696,732 LLVM-4.0.1-win32.exe 2017/08/26 15:11 ___ 2017/08/26 15:11 _殌 2017/08/26 15:11 _焵 1 个文件 95,696,732 字节 5 个目录 32,799,748,096 可用字节

libclang.lib can be found in _焵\lib

zllfdd commented 7 years ago

The reason has been found, the installation of lua5.1 with a low version of 7z.exe: 7-Zip 9.10 beta. It appears in the system's path environment variable, it is this version of the 7-zip caused the problem.

Another independently installed 7-zip version is 7-Zip [64] 16.02, able to correctly extract LLVM-4.0.1-win32.exe.

In the build, the use of the wrong 7-zip to extract, resulting in the problem.