In order to get
clang_complete to work on Windows x64 with Vim x64 and Python x64, libclang.dll must first be compiled from source.
Prerequisites
- Visual Studio 2010 or 2012
- Recent Vim x64 with Python27 support
- Python 2.7 x64
- CMake for Windows
Build
- Checkout llvm and clang using subversion. Trunk is version 3.3 at the time of this writing.
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm\tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
- Configure using cmake. Tweak the build command below to suit your system.
cmake C:\absolute\path\to\llvm -DPYTHON_EXECUTABLE="C:\Python27\python.exe" -DSubversion_SVN_EXECUTABLE="C:\Program Files\SlikSvn\bin\svn.exe" -DCMAKE_INSTALL_PREFIX="C:\clang" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86;CppBackend -G "Visual Studio 11 Win64"
- Build using cmake.
cmake --build . --config Release
- Install using cmake.
cmake --build . --config Release --target install
Install clang_complete
- Use Vundle or Pathogen to install clang_complete.
- In your vimrc, point clang_complete to your newly-compiled libclang.dll.
if has('win64')
let g:clang_library_path='C:/clang/bin'
endif
My interest was to build the 64 bit version of the libclang.dll. The build was successful but it seems that the 64bit version cannot be used with Python, I got a windows access error. I suspect that it might be possible that clang is not ms friendly (like different calling conventions ).
ReplyDeleteYou need to have 64-bit Python. I tested it and it's working for me.
DeleteI have a 64 bit Python installed. Could you share the libclang.dll and the cindex.py?
Delete