Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/bin/ld: cannot find -lclang when building irony-server #468

Closed
bollafa opened this issue Feb 25, 2018 · 2 comments
Closed

/usr/bin/ld: cannot find -lclang when building irony-server #468

bollafa opened this issue Feb 25, 2018 · 2 comments

Comments

@bollafa
Copy link

bollafa commented Feb 25, 2018

I've been trying to build irony-server, at the start I had problems related with not being able to find
the libclang libraries, but now it fails when it tries to link:

-*- mode: compilation; default-directory: "/tmp/build-irony-server-1.2.0/" -*-
Compilation started at Sun Feb 25 12:30:50

cmake -DCMAKE_INSTALL_PREFIX\=/home/bollafa/.emacs.d/irony/ /home/bollafa/.emacs.d/elpa/irony-20180104.1109/server && cmake --build . --use-stderr --config Release --target install
-- Irony package version is '1.2.0'
-- Found emacs: /usr/bin/emacs
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build-irony-server-1.2.0
[ 14%] Linking CXX executable ../bin/irony-server
/usr/bin/ld: cannot find -lclang
collect2: error: ld returned 1 exit status
src/CMakeFiles/irony-server.dir/build.make:225: recipe for target 'bin/irony-server' failed
make[2]: *** [bin/irony-server] Error 1
CMakeFiles/Makefile2:981: recipe for target 'src/CMakeFiles/irony-server.dir/all' failed
make[1]: *** [src/CMakeFiles/irony-server.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Compilation exited abnormally with code 2 at Sun Feb 25 12:30:50

I've searched and found related problems but their solutions didn't work ( they where also different programs ) :
Clang-complete
Crystal-lang

Thanks in advance.

@bollafa
Copy link
Author

bollafa commented Feb 25, 2018

Yay! Fixed! Thanks to this awesome post in stack-exchange : running ld in verbose mode.
Long story short: if you open ld in verbose mode you can see where does it try to open libclang.so
So the only thing i had to do was
locate libclang.so
To find where my libclang.so was, then i simply symlinked it!
sudo ln -s /usr/lib/llvm-3.8/lib/libclang.so /usr/lib/libclang.so

Hope this helps someone with the same (dumb) problem! :)

@bollafa bollafa closed this as completed Feb 25, 2018
@mavavilj
Copy link

mavavilj commented Feb 2, 2022

Yay! Fixed! Thanks to this awesome post in stack-exchange : running ld in verbose mode. Long story short: if you open ld in verbose mode you can see where does it try to open libclang.so So the only thing i had to do was locate libclang.so To find where my libclang.so was, then i simply symlinked it! sudo ln -s /usr/lib/llvm-3.8/lib/libclang.so /usr/lib/libclang.so

Hope this helps someone with the same (dumb) problem! :)

Any ideas, why this symlink is not defaulting in Ubuntu?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants