cannot open shared object file

I’m trying to install libsocketcan package in TorizonC/C++ project inside a container for in Colibri-imx7-1GO, to use SocketCAN APIs.
I added
devpackages : libsocketcan-dev:#%platform.debian-arch%#
extrapackage : libsocketcan2
In the Makefile, I added -lsocketcan to generate the lib ($(CC) -o $@ $^ $(CFLAGS) -lsocketcan)

After re-building the container and trying to execute the output file in the target device, I got this error:

./can-test: error while loading shared libraries: cannot open shared object file: No such file or directory

is there anything else to add ?

Thanks in advance.

Greetings @Achref,

First of all before we make any assumptions can you check whether the error message is accurate or not?

You can get a shell into the container by running this on the device while the container is running, docker exec -it <container ID/name> bash. Then you can manually check if file really does not exist.

Best Regards,

Greetings @jeremias.tx
Thanks for the reply,
yes, I already checked and I found it under /usr/lib/arm-linux-gnueabihf

Best regards

Hi @Achref !

Still from within the container, could you please run ldd <can-executable> and share the output?

Best regards,

Hi @henrique.tx
I hope that you are well
I have this problem,
When I executed it inside the container, I got the following output:

torizon@2b8660814812:/can-test$ ldd can-test (0xbea9c000) => /usr/lib/arm-linux-gnueabihf/ (0xb6f9d000) => /lib/arm-linux-gnueabihf/ (0xb6e9e000)
        /lib/ (0xb6fc2000)

but When executing it in the target device, the not found

torizon@colibri-imx7-emmc-14866722:~/can-test$ ldd can-test (0xbef72000) => not found => /usr/lib/ (0xb6e61000)
        /lib/ => /usr/lib/ (0xb6f66000)


Wait are you executing can-test inside the container? Or how are you executing it exactly? You mentioned that the container was created using our IDE extension is the IDE extension not executing the container/application?

The libraries and packages outside of the container are irrelevant since the application is meant to be executing in the context of the container.

Best Regards,

Hello @Achref
Do you have any updates on the topic?

Best regards,

Hi @josep.tx
Sorry for the late reply, I don’t have any update because I keep it in pending status and I switched to other project.