Accidentally deleted libArduCamTOFCamera.so needed for Arducam ToF Camera C++ project on Raspberry Pi

Hey everyone, I’m hitting a weird linking issue on my Raspberry Pi project. I’ve been using the ArduCam TOF camera SDK for a while now and everything was fine until I accidentally nuked the old SDK folder that had libArduCamTOFCamera.so in it. Now when I try to build my C++ program that includes ArduCamTOFCamera.hpp, the linker can’t find the shared library at all. I’m getting the usual cannot find -lArduCamTOFCamera error. Has anyone run into this after reinstalling the SDK?

That sounds like the library simply isn’t in your linker’s search path anymore. Have you tried reinstalling the arducam-tof-sdk-dev package from the Arducam PPA? That should restore everything that was in the old folder.

Yeah, that was the first thing I tried. I did sudo apt install --reinstall arducam-tof-sdk-dev and it seemed to go through fine, but when I actually look at what got installed, it’s weird. I can see the header file at /usr/include/ArduCamTOFCamera.hpp, but there’s no libArduCamTOFCamera.so anywhere on the system. I ran dpkg -L arducam-tof-sdk-dev and find /usr -name 'libArduCam*' and both come up empty for the .so file. It’s like the package only ships the header and forgot the library. I really just need that .so file — or a .deb that actually contains it — for Raspberry Pi OS (armhf).

I took a look at this and I can see where the confusion is coming from. The arducam-tof-sdk-dev package from the PPA does ship both the header and the shared library — the library just got renamed in the updated SDK and the header name stayed the same, which is why the mismatch isn’t obvious.

The old name: libArduCamTOFCamera.so
The new name: libArducamDepthCamera.so

So the linker is failing because you’re asking for -lArduCamTOFCamera but the library on disk is now libArducamDepthCamera.so. The header file kept its original name (ArduCamTOFCamera.hpp), so nothing looked out of place when you inspected the installed files.

Oh wow, that makes total sense now. I was going crazy searching for libArduCamTOFCamera.so and never even noticed libArducamDepthCamera.so sitting there. So what’s the right way to fix my build? I’m manually passing -lArduCamTOFCamera and an -L path right now in my Makefile. Do I just swap the -l flag?

Exactly — change your linker flag from -lArduCamTOFCamera to -lArducamDepthCamera. But rather than hardcoding paths and library names manually, the updated package ships a proper pkg-config file. You can get all the correct compiler and linker flags in one shot with:

pkg-config --cflags --libs ArducamDepthCamera

That’ll output the right include paths and the full -L / -l flags pointing to libArducamDepthCamera.so. So in a Makefile you’d do something like:

CXXFLAGS += $(shell pkg-config --cflags ArducamDepthCamera)
LDFLAGS  += $(shell pkg-config --libs ArducamDepthCamera)

This way you’re insulated from future renames or path changes. Worth considering cmake with find_package too if your project grows — same idea, just less manual maintenance.

That pkg-config trick worked perfectly, thank you. Builds clean now.

I actually have a related but separate question while I’m here. I’m trying to find an older version of the preview_pointcloud.cpp example script — the one that used PCL (PCLVisualizer) and OpenCV for point cloud visualization. I used to have it bookmarked but the original location doesn’t host it anymore. The version that’s available now uses Open3D instead, and Open3D is way too heavy to install and run on a Raspberry Pi. The old PCL+OpenCV version was nice and lightweight. Anyone know where I can still get that file?

Glad the linking fix sorted things out.

On the preview_pointcloud.cpp question — you’re right, the currently distributed version of that example switched over to Open3D, and it’s not really practical on a Pi. The older PCL+OpenCV variant was pulled from the main download location when the SDK examples were refreshed.

I don’t have a public permalink for it at the moment, but I’ll dig through the older SDK archives and see if I can track down the PCL-based version. If I find it, I’ll send you a link through a private message here on the forum. In the meantime, if anyone else in the community has a copy of the old preview_pointcloud.cpp that used pcl::visualization::PCLVisualizer and OpenCV, please chime in — it’s a useful lightweight alternative for embedded platforms.