4

I have to use the SNAP C-library.

I compiled my file snap_test.c with the following command:

gcc -fopenmp -c -I/home/myName/SNAPDIR/include snap_test.c 

And then linked it with the library:

gcc -fopenmp -o snap_test -L/home/myName/SNAPDIR/lib -lsnap snap_test.o 

But running the program leads to an error:

./snap_test: error while loading shared libraries: libsnap.so.0: cannot open shared object file: No such file or directory 

In the lib-dir there are those dirs and files:

libsnap.a libsnap.la libsnap.so (dir) libsnap.so.0 (dir) libsnap.so.0.0.0 

I guess the problem is the different versions of the libraries?!

1 Answer 1

2

You need to add /home/myName/SNAPDIR/lib to LD_LIBRARY_PATH.

$ export LD_LIBRARY_PATH+=:/home/myName/SNAPDIR/lib 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.