0

My program uses the libuvc-library and therefore the libuvc.so.0.

But after successful compilation, i can't run the program, because:

root@Raspi_DataHarvest:~/Schreibtisch# g++ UVCCameraHandler.cpp `pkg-config --libs --cflags opencv` `pkg-config --libs --cflags libuvc` -o UVCCameraHandler.o

./UVCCameraHandler.o: error while loading shared libraries: libuvc.so.0: cannot open shared object file: No such file or directory

The reason is:

root@Raspi_DataHarvest:~/Schreibtisch# ldd UVCCameraHandler.o
        linux-vdso.so.1 (0x7edff000)
        /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f1a000)
        libopencv_dnn.so.3.4 => /usr/local/lib/libopencv_dnn.so.3.4 (0x76bc7000)
        libopencv_ml.so.3.4 => /usr/local/lib/libopencv_ml.so.3.4 (0x76b20000)
******  libuvc.so.0 => not found  *******
...

The file is located in: /usr/local/lib/arm-linux-gnueabihf/libuvc.so.0.0.6

But I don't know how to link the .so file ...

1 Answer 1

2

You need to tell the run-time loader where to find your library, because this is not a normal path.

Use this command to run:

LD_LIBRARY_PATH="/usr/local/lib/arm-linux-gnueabihf:$LD_LIBRARY_PATH" ./a.out

Or you can export this LD_LIBRARY_PATH as a environment variable, and run ./a.out directly afterwards.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.