Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Building Neovim with MSVC 2015

Check the pull request for the changes and the main issue for discussion. If you run into trouble check the Known Errors section at the end, or drop me a comment.


  • MSVC 2015, cl should report > 19.*
  • Python 2 (required by libuv to get gyp) - python 3 will not work, see the issue
  • Git (required by libuv to get gyp)
  • libintl
  • You might need the Windows 10 SDK to be installed (unverified, please drop me a comment in #810, specially if you are in Windows8 or lower.)

Assuming you have all of the above, just get my work branch

git clone
cd neovim
git checkout tb-win32-any

Building Neovim dependencies

Before we can build Neovim we need to build some static dependencies, from the Neovim src folder do the following

mkdir .deps
cd .deps
cmake ..\third-party\
cmake --build . --config Release

If CMake complains that it cannot find Python, include the path to python.exe like this


Build Neovim

Go back to the main Neovim source directory and do the following

mkdir build
cd build
cmake ..
cmake --build . --config Release

nvim.exe should be in the bin/ folder. The windows version does not have a Terminal UI right now so you will need to use one of the available Neovim remote UIs (Atom, neovim-qt, python-client, ??).

Running the tests

The unit tests are not working, but the functional tests are. Some will fail for sure. After calling the initial cmake you can

cmake --build . --target functionaltest --config Release

Most likely this WILL GET STUCK. Check TEST_FILE to call a specific test.

Knowm Errors

Libuv/gyp error

Sometimes when building libuv, gyp will fail to use the correct version of visual studio and attempt to use another instead, e.g.

    C:\Program Files
    error MSB8020: The build tools for Visual Studio 2010 (Platform
    Toolset = 'v100') cannot be found. To build using the v100 build
    tools, please ins tall Visual Studio 2010 build tools.
    Alternatively, you may upgrade to the current Visual Studio tools by
    selecting the Project menu or right-click the solution, and then
    selecting "Upgrade Solution...". [E:\repos\neovim\.deps\build\src\l
    NMAKE : fatal error U1077: 'call' : return code '0x1' 

You can force the correct version with an environment variable


MSVC Runtimes

e.g. if you see errors like this you are using multiple runtimes across different libraries

 error LNK2005: ___scrt_acquire_startup_lock already defined in LIBCMTD.lib

See bottom line is you must NOT mix runtimes, i.e. all components MUST be built using the same runtime - right now I am using /MT or /MTd for Neovim (usually /MTd since builds default to Debug). Also some tricks to try and debug issues here

  • Also /VERBOSE:LIB may be helpful
  • Do not mix static (/MT) from different MSVC compilers, the result will not be pretty (e.g. undefined reference to snprintf)

Another variation of the same issue is

Debug Assertion Failed (_osfile(fh) & FOPEN)

This one trickier because it is a runtime exception, rather than a compile time error.

CMake build fails and the output is useless

When using the VS generator raise verbosity like this cmake --build . -- /verbosity:detailed.

Another alternative is to use cmake with the nmake generator, add -G "NMake Makefiles" to the initial cmake commands, but requires the cl/nmake commands to be in your PATH (e.g. call vcvarsall32.bat). Use nmake VERBOSE=1 to build.


This comment has been minimized.

Copy link

@zolem zolem commented Jun 23, 2015

I get the following error when running the last command below. Any ideas? I am using babun.

mkdir .deps
cd .deps
cmake ..\third-party\
cmake --build .
[ 10%] Performing install step for 'jemalloc'
install -m 644 include/jemalloc/jemalloc.h /home/Rudy/projects/neovim/.deps/usr/include/jemalloc
src/jemalloc.c:1:0: warning: -fPIC ignored for target (all code is position independent)
 #define JEMALLOC_C_
In file included from src/jemalloc.c:2:0:
include/jemalloc/internal/jemalloc_internal.h:17:27: fatal error: sys/syscall.h: No such file or directory
 #  include <sys/syscall.h>
compilation terminated.
Makefile:236: recipe for target 'src/jemalloc.pic.o' failed
make[3]: *** [src/jemalloc.pic.o] Error 1
CMakeFiles/jemalloc.dir/build.make:65: recipe for target 'build/src/jemalloc-stamp/jemalloc-install' failed
make[2]: *** [build/src/jemalloc-stamp/jemalloc-install] Error 2
CMakeFiles/Makefile2:134: recipe for target 'CMakeFiles/jemalloc.dir/all' failed
make[1]: *** [CMakeFiles/jemalloc.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

This comment has been minimized.

Copy link

@fntlnz fntlnz commented Aug 14, 2015

Thank you for this gist!
Just a thing, the package lua-messapack does not exists, I think it should be lua-messagepack


This comment has been minimized.

Copy link
Owner Author

@equalsraf equalsraf commented Aug 29, 2015

FYI sadly gist does not send notifications when you guys comment, so I completely missed these two comments.


This comment has been minimized.

Copy link

@tallpauley tallpauley commented Mar 11, 2016

For those who are just looking for a working binary, grab an installer exe from the latest passing build:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment