Error when running: "libclang.so: cannot open shared object file: No such file or directory"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 127
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
First, I ran `sudo apt-get install python-yaml` and `sudo pip install clang`. Success.
Then I tried:
```
[dev@ubuntu:~/cncc (master)] $ ls
cncc examples LICENSE MyClass.cpp MyClass.h README.md util
[dev@ubuntu:~/cncc (master)] $ git log -1
commit 4529cb3536c7cec20ea0bb850d0f95e80cded733
Author: Daniel J. Hofmann
Date: Wed Aug 19 14:55:48 2015 +0200
Respect global style file, closes #5
Local style files do not seem to make a lot sense. What we could do is
walk all parent directories like `clang-format` does, though.
[dev@ubuntu:~/cncc (master)] $ cat MyClass.h
class MyClass{
public:
void init(int a, int b);
int loopAlot();
private:
int var1, var2;
};
[dev@ubuntu:~/cncc (master)] $ cat MyClass.cpp
#include "MyClass.h"
void MyClass::init(int a, int b){
var1 = a;
var2 = b;
}
int MyClass::loopAlot(){
int res = this->var1 + var2;
for(int i=0; ivar1; ++i){
res = res + this->var2;
}
return res;
}
[dev@ubuntu:~/cncc (master)] $ ./cncc --style=examples/basic.style MyClass.cpp
Traceback (most recent call last):
File "./cncc", line 22, in
index = I.create()
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 2119, in create
return Index(conf.lib.clang_createIndex(excludeDecls, 0))
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 141, in __get__
value = self.wrapped(instance)
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 3429, in lib
lib = self.get_cindex_library()
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 3460, in get_cindex_library
raise LibclangError(msg)
clang.cindex.LibclangError: libclang.so: cannot open shared object file: No such file or directory. To provide a path to libclang use Config.set_library_path() or Config.set_library_file().
```
Any idea what I'm doing wrong?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the cncc entry point around line 22 and the Python clang.cindex setup shown in the traceback. Reproduce the documented ./cncc --style=examples/basic.style MyClass.cpp command and inspect how the libclang dependency is located. Done means the command runs without the missing libclang.so error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100