Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:
vim --version.:YcmDebugInfo.:YcmToggleLogs command.vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what Iinstall.py (or cmake/make/ninja) including its invocationThank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Provide a clear description of the problem, including the following key
questions:
After installing YCM successfully, when entering vim, the Ycmd server shut down, as shown

And the err log shows:
Traceback (most recent call last):
4 File "/mnt/lun1/home/htliu/soft/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 498, in ImportAndCheckCore
3 ycm_core = ImportCore()
2 File "/mnt/lun1/home/htliu/soft/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 489, in ImportCore
1 import ycm_core as ycm_core
7 ImportError: /mnt/lun1/home/htliu/soft/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so: undefined symbol: _ZNKSt10filesystem7__cxx114path12has_filenameEv
Some install snapshots :



Include steps to reproduce here.
vim -Nu /path/to/YCM/ycm_vimrc_minimal:edit test.py.....Include description of a minimal test case, including any actual code required
to reproduce the issue.
If you made changes to
vimrc_ycm_minimal, pase them here:
<contents of ycm_vimrc_minimal>
Include description of the expected behaviour.
Include description of the observed behaviour, including actual output,
screenshots, etc.
vim --versionVIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 24 2020 16:26:37)
Included patches: 1-1897
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
-autoservername +folding +multi_byte +termguicolors
-balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
-browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 -perl +title
-clientserver +job +persistent_undo -toolbar
-clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall -python +visual
+conceal +linebreak +python3 +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape -lua -ruby +wildmenu
+dialog_con +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent -X11
-dnd +mouse +sound -xfontset
-ebcdic -mouseshape +spell -xim
+emacs_tags +mouse_dec +startuptime -xpm
+eval +mouse_gpm +statusline -xsmp
+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fdebug-prefix-map=/build/vim-KZNIhZ/vim-8.2.1897=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lcanberra -lacl -lattr -lgpm -ldl -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm
YcmDebugInfoPrinting YouCompleteMe debug information...
-- Resolve completions: Never
-- Client logfile: /tmp/ycm_i4uoaqmt.log
-- Server errored, no debug info from server
-- Server running at: http://127.0.0.1:47463
-- Server process ID: 4527
-- Server logfiles:
-- /tmp/ycmd_47463_stdout_zmabn8_y.log
-- /tmp/ycmd_47463_stderr_9x0lb3h1.log
YcmDiagsPaste output here
git rev-parse HEAD in YouCompleteMe installation directory
Reproduce the issue with
vim -Nu /path/to/YCM/vimrc_ycm_minimal, which
enabled debug logging and other useful diagnostics. Include a link to a
gist containing all of the log files listed by:YcmToggleLogs.
Include system information here.
Ubuntu 18.04 Server
Include link to a gist containing the invocation and entire output of
install.pyif reporting an installation issue.
You'll have to post the entire output of the install script. Also, this will be easier to troubleshoot on gitter instead.
Thanks for your advice, my install script is:
CXX=/usr/bin/gcc-8 ./install.py --clang-completer
I asked for the output of that, not just the invocation.
my guess is that because you used a non-system-defualt compiler, it's expecting a different standard library at runtime
The whole output is in https://paste.ubuntu.com/p/q5xfFZfYGp/
@puremourning Thanks for your reply. Yeah, since the default-system gcc version is 7.5.0, which could not support C++17, hence I have to install gcc8, but I would not to replace the default gcc7.
Maybe I can user update-alternatives to have a try.
Immediately, I see a few problems:
That second one is going to be a problem.
https://github.com/bstaletic/ycmd/blob/cxx17/cpp/ycm/CMakeLists.txt#L317-L345
Can you compile this code?
#include <filesystem>
int main( int argc, char ** argv ) {
std::filesystem::path p( argv[ 0 ] );
return p.string().length();
}
Note that gcc 8 need -lstdc++fs flag to correctly compile the above.
Hi, it indeed the compiler issues, I have changed the system-default-gcc into 8.x, and re-compile YCM, the problem has been solved.
Thanks!
@puremourning Maybe we should make "Unknown compiler" warning a hard error. Thoughts?
@ShomyLiu I almost forgot. Check out --clangd-completer - it has more features and is faster. Details are in the readme.
Nice, thanks, I would install again to have a try.
Most helpful comment
my guess is that because you used a non-system-defualt compiler, it's expecting a different standard library at runtime