Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++: Weird shared library error - eclipse

Tags:

c++

eclipse

cuda

I'm trying to compile some code. Here is the error I'm getting:

error while loading shared libraries: libcudart.so.4: cannot open shared object file

Now I've included /usr/local/cuda/include and linked to /usr/local/cuda/lib and passed the -lcudart flag on the compile prompt.

Yet I still get this run-time error!

I've just started using Eclipse, and this is really annoying.

Any insight greatly appreciated.

Thanks in advance,

like image 871
Eamorr Avatar asked Feb 26 '26 05:02

Eamorr


1 Answers

This usually happens with old code when they change the folder structure. Locate where the file is expected in the old code, then make a sym link to where it actually is.

Also try launching eclipse as root. Or running:

ldconfig /usr/local/cuda/lib
like image 96
Mikhail Avatar answered Feb 27 '26 20:02

Mikhail



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!