3

I'm trying to install and use LibClang's python bindings on Mac OS 10.8, and I've run into a problem with the installed version of the libclang.dylib shared library.

I've built LLVM and clang from source as described on the LLVM website, and I can import the clang.cindex module from a Python script. However, when I try to use any of its' contents, the module throws this error:

clang.cindex.LibclangError: dlsym(0x7f8a314d5f50, clang_CXXMethod_isPureVirtual): symbol not found. Please ensure that your python bindings are compatible with your libclang.so version. 

There's an existing version in /usr/lib which I presume was put there by XCode (or required by the system, probably used by dyld), but I guess it's too old to be used with the current bindings. I found another libclang.dylib hidden in a Debug+Asserts folder in the LLVM build directory, but I'm not sure how to force Python to link against it instead of the one in /usr/lib. Is there any way to force the Python libclang bindings to link against a particular version of the libclang dynamic library?

2
  • I have the same error but with another method, maybe my searching will be helpfull for you.
    – aknew
    Commented Oct 2, 2013 at 12:42
  • Too fast tap enter ) First, two version of libclang (in /usr/lib and inside xcode) have the same set of methods (you can see it with console "nm -L$PathToClanglib"), but they are different (md5 is not equals). Second - error created when python try bind his class lib methods to lybclang.dylib functions, but sets are no equals, set of python methods is in the end of cindex.py in functionList variable, may be you can exclude clang_CXXMethod_isPureVirtual if it not use in any other places (my version not contains it, it was installed with easy_install)
    – aknew
    Commented Oct 2, 2013 at 12:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.