Posts: 2
Joined: Tue Nov 24, 2015 8:41 am

/usr/bin/ld: cannot find -lc++

Tue Nov 24, 2015 8:47 am

I compiling a project and I stumbled on this error:

/usr/bin/ld: cannot find -lc++

I'm building a project on raspbian (RPI 2) using clang.

Can you please tell me what is the problem here?


User avatar
Posts: 2782
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: /usr/bin/ld: cannot find -lc++

Tue Nov 24, 2015 1:34 pm

The problem is the linker cannot find a library called c++. I assume you mean to link the standard c++ library which is called stdc++ e.g.

Code: Select all

clang -o main main.cpp -lstdc++
She who travels light — forgot something.

Return to “C/C++”