Youcompleteme: CMake Error: Could not create named generator Visual Studio 14 Win64

Created on 26 Sep 2016  ·  5Comments  ·  Source: ycm-core/YouCompleteMe

Issue Prelude

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

  • [x] I have read and understood YCM's CONTRIBUTING document.
  • [x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [x] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [x] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • [x] If filing a bug report, I have included the output of vim --version.
  • [ ] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [ ] If filing a bug report, I have included the output of
    :YcmToggleLogs stderr.
  • [x] If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • [ ] If filing a bug report, I have included a minimal test case that reproduces
    my issue.
  • [x] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt _gift_ of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [x] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

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

I tried to compile the ycm plugin for my Vim 8.0.3 in Windows 10, and I followed the YouCompleteMe#windows .Following are the step I tried to do.

1) Already downloaded gvim80_x64.zip from this link and installed my Vim 8.0 to E:\vim\gvim_8.0.0003_x64\vim;

2) Downloaded the latest YCM respos from here and did
git submodule update --init --recursive;
the result is
E:\vim\gvim_8.0.0003_x64\vim\vimfiles\YouCompleteMe>git submodule update --init --recursive; usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>] or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...] or: git submodule [--quiet] init [--] [<path>...] or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...) or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...] or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...] or: git submodule [--quiet] foreach [--recursive] <command> or: git submodule [--quiet] sync [--recursive] [--] [<path>...]

3) Copied the ycm toC:\Vim\vimfiles\bundle and Installed the ycm in Vim with Vundle;

4) Raninstall.py --all inE:\vim\gvim_8.0.0003_x64\vim\vimfiles\YouCompleteMe>
Unfortunately, it failed at install.py, please check the > Section4. to see the details.

OS envirnoment

win10 pro
E:\vim\gvim_8.0.0003_x64\vim\vimfiles\YouCompleteMe>ver Microsoft Windows [版本 10.0.14393]

Relevant Software informations

  • vim
`VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 12 2016 22:03:09)
MS-Windows 64-bit console version
包含补丁: 1-3
编译者 appveyor@APPVYR-WIN
巨型版本 无图形界面。  可使用(+)与不可使用(-)的功能:
+acl                +ex_extra           -mouseshape         +tag_old_static
+arabic             +extra_search       +multi_byte_ime/dyn -tag_any_white
+autocmd            +farsi              +multi_lang         +tcl/dyn
-balloon_eval       +file_in_path       +mzscheme/dyn       +termguicolors
-browse             +find_in_path       -netbeans_intg      -tgetent
++builtin_terms     +float              +num64              -termresponse
+byte_offset        +folding            +packages           +textobjects
+channel            -footer             +path_extra         +timers
+cindent            +gettext/dyn        +perl/dyn           +title
+clientserver       -hangul_input       +persistent_undo    -toolbar
+clipboard          +iconv/dyn          -postscript         +user_commands
+cmdline_compl      +insert_expand      +printer            +vertsplit
+cmdline_hist       +job                +profile            +virtualedit
+cmdline_info       +jumplist           +python/dyn         +visual
+comments           +keymap             +python3/dyn        +visualextra
+conceal            +lambda             +quickfix           +viminfo
+cryptv             +langmap            +reltime            +vreplace
+cscope             +libcall            +rightleft          +wildignore
+cursorbind         +linebreak          +ruby/dyn           +wildmenu
+cursorshape        +lispindent         +scrollbind         +windows
+dialog_con         +listcmds           +signs              +writebackup
+diff               +localmap           +smartindent        -xfontset
+digraphs           +lua/dyn            +startuptime        -xim
-dnd                +menu               +statusline         -xpm_w32
-ebcdic             +mksession          -sun_workshop       -xterm_save
+emacs_tags         +modify_fname       +syntax
+eval               +mouse              +tag_binary
     系统 vimrc 文件: "$VIM\vimrc"
     用户 vimrc 文件: "$HOME\_vimrc"
 第二用户 vimrc 文件: "$HOME\vimfiles\vimrc"
 第三用户 vimrc 文件: "$VIM\_vimrc"
      用户 exrc 文件: "$HOME\_exrc"
  第二用户 exrc 文件: "$VIM\_exrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
编译方式: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_CSCOPE  -DFEAT_JOB_CHANNEL      -DWINVER=0x500 -D_WIN32_WINNT=0x500  /Fo.\ObjCULYHTRZAMD64/ -DHAVE_STDINT_H /Ox /GL -DNDEBUG  /Zl /MT -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_MBYTE -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python35.dll\" -DFEAT_MZSCHEME -I "C:\Program Files\Racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracket3m_a0solc.dll\" -DDYNAMIC_MZGC_DLL=\"libracket3m_a0solc.dll\" -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=\"x64-msvcrt-ruby220.dll\" -DFEAT_HUGE /Fd.\ObjCULYHTRZAMD64/ /Zi
链接方式: link /RELEASE /nologo /subsystem:console /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib uuid.lib /machine:AMD64  /nodefaultlib libcmt.lib  user32.lib  /nodefaultlib:lua53.lib  /STACK:8388608  /nodefaultlib:python27.lib /nodefaultlib:python35.lib   "C:\Tcl\lib\tclstub86.lib" WSock32.lib /PDB:vim.pdb -debug`
  • python
E:\vim\gvim_8.0.0003_x64\vim\vimfiles\YouCompleteMe>python --version
Python 3.5.2
  • cmake

cmake version 3.3.2 CMake suite maintained and supported by Kitware (kitware.com/cmake).

ERROR Details

E:\vim\gvim_8.0.0003_x64\vim\vimfiles\YouCompleteMe>install.py --all
Searching Python 3.5 libraries...
Found Python library: E:\Python\Python35\libs\python35.lib
Found Python headers folder: E:\Python\Python35\include
CMake Error: Could not create named generator Visual Studio 14 Win64

Generators
  Unix Makefiles               = Generates standard UNIX makefiles.
  Ninja                        = Generates build.ninja files.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.
  KDevelop3                    = Generates KDevelop 3 project files.
  KDevelop3 - Unix Makefiles   = Generates KDevelop 3 project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                               = Generates Sublime Text 2 project files.

Traceback (most recent call last):
  File "E:\vim\gvim_8.0.0003_x64\vim\vimfiles\YouCompleteMe\third_party\ycmd\build.py", line 359, in BuildYcmdLib
    subprocess.check_call( [ 'cmake' ] + full_cmake_args )
  File "E:\Python\Python35\lib\subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '-G', 'Visual Studio 14 Win64', '-DPYTHON_LIBRARY=E:\\Python\\Python35\\libs\\python35.lib', '-DPYTHON_INCLUDE_DIR=E:\\Python\\Python35\\include', '-DUSE_CLANG_COMPLETER=ON', '-DUSE_PYTHON2=OFF', 'E:\\vim\\gvim_8.0.0003_x64\\vim\\vimfiles\\YouCompleteMe\\third_party\\ycmd\\cpp']' returned non-zero exit status 1


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.

Traceback (most recent call last):
  File "E:\vim\gvim_8.0.0003_x64\vim\vimfiles\YouCompleteMe\install.py", line 44, in <module>
    Main()
  File "E:\vim\gvim_8.0.0003_x64\vim\vimfiles\YouCompleteMe\install.py", line 33, in Main
    subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
  File "E:\Python\Python35\lib\subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['E:\\Python\\Python35\\python.exe', 'E:\\vim\\gvim_8.0.0003_x64\\vim\\vimfiles\\YouCompleteMe\\third_party\\ycmd\\build.py', '--all']' returned non-zero exit status 1

Most helpful comment

You are probably using the CMake from Cygwin (or MinGW, MSYS2, etc.), which does not have the Visual Studio generators, instead of the Windows version. You need to download and install CMake for Windows. Pick the Add CMake to the system PATH for all users option during the installation. Once installed, run again the install.py script.

All 5 comments

You are probably using the CMake from Cygwin (or MinGW, MSYS2, etc.), which does not have the Visual Studio generators, instead of the Windows version. You need to download and install CMake for Windows. Pick the Add CMake to the system PATH for all users option during the installation. Once installed, run again the install.py script.

@micbou
it's works ,thank u so much!

Happy to help.

Just to add my case, since the error message is similar.
Following the Windows installation guide, I installed the latest cmake.
Run install.py and get CMake Error: Could not create named generator Visual Studio 15 Win64.
The reason is I've installed cmake 2.8 before. After uninstall the old cmake, install.py finished with no problem.

You are probably using the CMake from Cygwin (or MinGW, MSYS2, etc.), which does not have the Visual Studio generators, instead of the Windows version. You need to download and install CMake for Windows. Pick the Add CMake to the system PATH for all users option during the installation. Once installed, run again the install.py script.

Just adding a case too:
I had both, Cygwin and CMake, installed but had the PATHs in the wrong order. The solution was to switch the order so CMake comes first. Otherwise, the Cygwin version is found first, which will give you a perfectly valid CMake CLI with some features (like adding the VS generator) stripped away.

Was this page helpful?
0 / 5 - 0 ratings