A D
A D

Reputation: 305

Clang won't see headers

I update clang and apparently it forgets where to find the standard library ie

reactions/baseReaction.cc:11:10: fatal error: 'vector' file not found
#include <vector>

I install libc++ with

 sudo apt-get install libc++-dev

but when I try

ln -s /usr/bin/c++ /usr/bin/clang++-libc++

it gives

ln: failed to create symbolic link ‘/usr/bin/clang++-libc++’: File exists

and I still cannot use make

EDIT: tried

sudo update-alternatives --config c++

and

CXX=clang++-libc++ make

no joy so far

EDIT2: modifying the makefile with CXX=clang++-libc++ seems to have worked.

Upvotes: 0

Views: 621

Answers (1)

user10186512
user10186512

Reputation: 453

More advisably than manually creating the symlink, since you seem to be on a Debian-based system, you could try sudo update-alternatives --config c++ to have the OS create that symbolic link for you. It should bring up a selection of all the C++ compilers you have installed on your systems. (See also the manpage for update-alternatives for future reference, either locally or online here.)


Note that if you meant for the file /usr/bin/c++ to be a symbolic link to /usr/bin/clang++-libc++, your argument order is wrong. A good rule of thumb is that you use the same argument order for ln as you would use for cp or mv.

Upvotes: 2

Related Questions