Open daniele-niero opened 8 years ago
I have noticed something.
Consider this code:
from ctypes import *
lib_file = 'libclang.dll'
lib = CDLL(lib_file)
print lib.clang_getClangVersion()
The result is every and each time different!! No wonder it causes problems. :(
Update the code above is not complete actually. refer to this please:
from ctypes import *
lib_file = 'libclang.dll'
lib = CDLL(lib_file)
version = lib.clang_getClangVersion
version.restype = c_char_p
print version()
Wich works just fine with LLVM 32 and called by some python 32, but returns always a different result with LLVM 64 and called with python 3.3 64 (from within Sublime 64)
ok, I don't know your background, so sorry if I say something you already know... :wink: Sublime Text won't use your system installed python, it is packed with its own! to do any test you need to open Sublime's console and enter your python codes there...
about your error, I don't have a windows machine to test, but apparently the try/catch is not working on windows.... try commenting out the try/catch letting the catch block as the only one available and tell the result, please.
I'm quite proficient with python and I know all the intricacies with the different pythons installed :) but don't worry, you right to ask.
I have tried both with python 2.7 32 bit installed on my machine and with python 3.3 64 bit included in Sublime. Obviously being careful to use the right LLVM, 32 or 64.
Python 2.7 32 and LLVM (and clang) 32 bit, give back the right result. Disaster strikes with the 64 bit versions.
Now there is another problem. On windows the only binary distribution I have found of LLVM is version 3.9 (http://llvm.org/builds/). I don't even want to try to compile it myself on windows :). You included cindex38.py maximum, and in fact, even if I force the use of it, the plugin fails:
Traceback (most recent call last):
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\codeCompletion.py", line 208, in done
set_view(self.view, True)
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\codeCompletion.py", line 123, in set_view
TranslationUnit.PARSE_CACHE_COMPLETION_RESULTS)
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\clang\cindex38.py", line 2338, in from_source
index = Index.create()
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\clang\cindex38.py", line 2225, in create
return Index(conf.lib.clang_createIndex(excludeDecls, 0))
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\clang\cindex38.py", line 144, in __get__
value = self.wrapped(instance)
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\clang\cindex38.py", line 3585, in lib
register_functions(lib, not Config.compatibility_check)
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\clang\cindex38.py", line 3532, in register_functions
list(map(register, functionList))
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\clang\cindex38.py", line 3530, in register
return register_function(lib, item, ignore_errors)
File "C:\Users\daniele.niero.LOST_BOYS_GAMES\AppData\Roaming\Sublime Text
3\Packages\clangHelper\clang\cindex38.py", line 3511, in register_function
raise LibclangError(msg)
clangHelper.clang.cindex38.LibclangError: function
'clang_CXXField_isMutable' not found. Please ensure that your python
bindings are compatible with your libclang.so version.
I haven't noticed the new version of LLVM... just wait a bit (if I have the time tomorrow) and I will add it! it's just a matter of changing the LLVM python bindings to python 3, it's written in python 2...
Hello,
This error seems somehow similar to the others, but still slightly different to deserve an issues report all for it :)
What generates the problem is this call
version().decode()
in libclang_version.pySystem Information
I'm also pretty sure I have LLVM 64 bits. At least the installer claimed to be 64...