When i use Gvim edit a .cpp file, a windows come up immediately.
Microsoft Visual C++ Runtime library
Assertion failed!
Program:
..bundle\YouCompleteMe\thirdparty.ycmd\libclang.dll
File: D:src\llvm_package_4.0.0\Ilvm\tools.../SourceLocation.h
line: 319
Expression: SrcMgr = = Loc.SrcMgr && Loc comes from
another SourceManagerr
For information on how your program can cause an assertion
failure. see the Visual C++ documentation on asserts
(Press Retry to debug the application - JIT must be enabled)
what's going wrong? or what should i do ? thanks for your help!
Are you using a custom libclang build or the one out installer downloads?
On 18 May 2017, at 03:12, Patrick Dai notifications@github.com wrote:
When i use Gvim edit a .cpp file, a windows come up immediately.
Microsoft Visual C++ Runtime library
Assertion failed!
Program:
..bundle\YouCompleteMe\thirdparty.ycmd\libclang.dll
File: D:src\llvm_package_4.0.0\Ilvm\tools.../SourceLocation.h
line: 319
Expression: SrcMgr = = Loc.SrcMgr && Loc comes from
another SourceManagerr
For information on how your program can cause an assertion
failure. see the Visual C++ documentation on asserts
(Press Retry to debug the application - JIT must be enabled)what's going wrong? or what should i do ? thanks for your help!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
i simply use command "./install.py --clang-completer", and before that step, i have cmake and llvm installled.
Does it happen for any C++ project? Can you provide a test case (source file and .ycm_extra_conf.py) that reproduces the issue? Also, which version of Windows?
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-fexceptions',
'-DNDEBUG',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of
# 'c++11'.
'-std=c++11',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x',
'c++',
'-isystem',
'C:\Program Files\LLVM\include',
'-isystem',
'C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include',
'-isystem',
'C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++',
'-isystem',
'C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/backward',
'-isystem',
'C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/x86_64-w64-mingw32',
]
I am using Win10 1607, any simple cpp code may cause this problem.
The official LLVM :
-DLLVM_ENABLE_ASSERTIONS=On — Compile with assertion checks enabled (default is Yes for Debug builds, No for all other build types).
You should compile your LLVM with -DLLVM_ENABLE_ASSERTIONS=NO,it work for me.
The official LLVM :
-DLLVM_ENABLE_ASSERTIONS=On — Compile with assertion checks enabled (default is Yes for Debug >builds, No for all other build types).
You should compile your LLVM with -DLLVM_ENABLE_ASSERTIONS=NO,it work for me
I am a beginner of YouCompleteMe. Can you elaborate a bit more? So i need to use the full installation method? I should compile my LLVM and CLANG myself?? Can i just download the pre build one?
you should compile LLVM and CLANG,refer to:
https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang_format_binaries.md
My build.cmd:
set CC=cl
set CXX=cl
cmake -G Ninja ..\llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO -DPYTHON_EXECUTABLE=C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\python.exe
Thank you so much, it is very helpful. But then i should follow the full installation instructions right? I am reading the guide for the full installation. It says that if we wish to use custom libclang, we have to refer to libclang.so, but I can't find it.... How did you do after compiling LLVM and CLANG to install YCM.. THX again..... i have been reinstalling windows just to get YCM working.. but it can't
where cmake.exe # You need to install this.
where svn.exe # Maybe fix with: set PATH=%PATH%;D:\src\depot_tools\svn_bin
"c:\Program Files (x86)\Microsoft Visual Studio 14.0\vc\vcvarsall.bat" amd64_x86
set CLANG_REV=198831 # You must change this value (see above)
[from a clean directory, check out and build]
rmdir /S /Q llvm
rmdir /S /Q llvm-build
mkdir llvm
mkdir llvm-build
svn co http://llvm.org/svn/llvm-project/llvm/branches/release_40 llvm
cd llvm\tools
svn co http://llvm.org/svn/llvm-project/cfe/branches/release_40 clang
cd ..\..\llvm-build
set CC=cl
set CXX=cl
cmake -G Ninja ..\llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO -DPYTHON_EXECUTABLE=C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\python.exe
ninja all
llvm svn address: http://llvm.org/svn/llvm-project/llvm/branches/release_40
clang svn address: http://llvm.org/svn/llvm-project/cfe/branches/release_40
make sure your ninja.exe in %PATH%
Really appreciate it, i am able to compile llvm and clang after following your steps. However, is it i have to compile ycm with -DEXTERNAL_LIBCLANG_PATH to the path of libclang.dll that i compiled?
i compiled that ycm with : cmake -G "Visual Studio 15 Win64" . "C:\Program Files\vim.vim\bundle\YouCompleteMe\third_party\ycmd\cpp" -DEXTERNAL_LIBCLANG_PATH="C:\llvm-build\bin\libclang.dll"
then : make --build . --target ycm_core --config Release
(it shows libclang.dll : fatal error LNK1107)
set EXTRA_CMAKE_ARGS="-DPATH_TO_LLVM_ROOT=D:/tools/LLVM4.0"
python install.py --clang-completer --system-libclang --omnisharp-completer --gocode-completer --msvc=14 --tern-completer
I use visual studio 2017 ..
I got that it would cause the Assertion Error when you add c-header-path and cpp-header-path to ycm_extra_conf.py at the same time.
For example:
you should comment PART 1 for c++ project or comment PART 2 for c project at the ycm_extra_conf.py below.
WIN_GW = 'C:/MyApps/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/'
WIN_GW_C = 'C:/MyApps/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/'
WIN_GW_CPP = 'C:/MyApps/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++'
flags = [
# User Defined
# PART 1
'-isystem',
WIN_GW,
'-isystem',
WIN_GW + 'ssp',
# PART 2
# '-isystem',
# WIN_GW + 'c++',
# '-isystem',
# WIN_GW + 'c++/bits',
# '-isystem',
# WIN_GW + 'c++/profile',
# '-isystem',
# WIN_GW + 'c++/x86_64-w64-mingw32',
# '-isystem',
# WIN_GW + 'c++/x86_64-w64-mingw32/bits',
i will try it.
@ketop Could you try again with the latest version of YCM? You'll need to run the install.py script with the --clang-completer option after updating YCM.
I am going to assume this is fixed in the latest version of YCM (it should be). We can always reopen if that's not the case.
Most helpful comment
llvm svn address: http://llvm.org/svn/llvm-project/llvm/branches/release_40
clang svn address: http://llvm.org/svn/llvm-project/cfe/branches/release_40
make sure your ninja.exe in %PATH%