A missing camera SDK header during a container build is usually a development-file or compiler-search-path problem, not a camera connection problem. For engineers compiling a ROS 2 camera component, the useful question is what the compiler can access inside the failing build stage. Start there before changing device permissions, transport settings or runtime library paths. The checks below separate absent headers, incorrect include roots, environment setup and dependencies supplied only when the container starts.
1. Identify the first failure and its build phase
Read upward from the final build summary to the first diagnostic that names a missing file. A package marked failed or aborted is an outcome, not necessarily the origin of the problem.
Record the requested header, the source file being compiled and the target owning that compilation. If 2 source files fail while including the same SDK header, investigate their shared dependency before editing either source file.
Different build phases require different fixes:
| First meaningful symptom | Phase | First check |
|---|---|---|
| SDK header cannot be found | Preprocessing or compilation | Header installation and compiler include roots |
| SDK package configuration cannot be found | Configuration | Package installation prefix and discovery settings |
| SDK library cannot be found | Linking | Development libraries and target link dependencies |
| Shared library cannot be loaded | Runtime | Loader paths and runtime library availability |
| Camera cannot be opened | Runtime acquisition | Device access, transport and supported configuration |
Finding ROS 2 successfully does not establish that a separate camera SDK is installed correctly. Keep those dependencies separate when reading configuration messages.
The related SDK include-path build checks explain the same distinction between installing a dependency and making it visible to a target.
2. Check development files inside the failing stage
Inspect the filesystem in the image stage that actually runs the compiler. Headers installed on the host, copied into another stage or mounted into an interactive container are not automatically available during an image build.
A development label on a base image is useful context, but checking the required files is stronger evidence. Temporarily add a diagnostic build instruction before compilation, or create an inspectable intermediate stage containing the same installation steps.
The following commands use an illustrative SDK layout, not an installation path prescribed for any product:
find /opt/camera_sdk -type f -name 'Device.hpp' -print
ls -ld /opt/camera_sdk/include
ls -l /opt/camera_sdk/include/camera_sdk/Device.hpp
If the header is absent, check whether the installation included the SDK development component. A runtime package may contain shared libraries without headers, package configuration files or other development artifacts.
Also check for these differences:
- The installer ran in an earlier stage, but its files were never copied into the builder stage.
- A later copy operation replaced the installation directory.
- A volume mount exposes files during interactive testing but not during image construction.
- A symbolic link points outside the files available in the current stage.
- The filename differs in capitalization from the include directive.
Obtain missing SDK files only from the manufacturer or its authorized distributors. Do not substitute an unrelated header copied from another SDK release.
3. Work backward from the include directive
When the header exists, determine which directory the compiler must search. The include root is not always the directory immediately containing the file.
Suppose the source contains this illustrative directive:
#include <camera_sdk/Device.hpp>
The installed file is:
/opt/camera_sdk/include/camera_sdk/Device.hpp
The correct search root is /opt/camera_sdk/include. The compiler appends the requested relative path to each search directory:
Adding /opt/camera_sdk/include/camera_sdk instead would duplicate the final directory component. The resulting candidate would end in /camera_sdk/camera_sdk/Device.hpp, which does not match this example layout.
Test that reasoning independently of the ROS 2 package:
printf '#include <camera_sdk/Device.hpp>\n' |
c++ -E -x c++ -I/opt/camera_sdk/include - > /dev/null
Use the compiler selected by the failing build, particularly when cross-compiling. If the probe succeeds but the package still fails, inspect the package's actual compiler invocation. If the probe reaches a different missing dependency, the original header was found; continue with the newly identified requirement.
4. Attach the dependency to the compiling target
A directory can exist and still be absent from the compiler command. Enable verbose build output or export the compilation database, then inspect the command for the failing source file.
With a CMake-based workspace, this diagnostic build requests a compilation database:
colcon build --packages-select inspection_component \
--event-handlers console_direct+ \
--cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
Here, inspection_component is an illustrative package name. Substitute the package that actually fails. Inspect its compile_commands.json and look for the expected include root in -I or -isystem arguments.
Prefer the SDK's documented CMake package and imported targets when available. Those targets can carry include directories, libraries and transitive dependencies together. Merely setting a package-discovery prefix does not attach a dependency to the compiling target.
For an SDK without suitable exported targets, an explicit include-path setup can look like this:
set(CAMERA_SDK_ROOT "/opt/camera_sdk" CACHE PATH "SDK installation root")
find_path(CAMERA_SDK_INCLUDE_DIR
NAMES camera_sdk/Device.hpp
HINTS "${CAMERA_SDK_ROOT}/include"
REQUIRED
)
target_include_directories(inspection_component PRIVATE
"${CAMERA_SDK_INCLUDE_DIR}"
)
This example assumes the target already exists and uses the SDK only internally. If installed public headers include SDK headers, downstream consumers also need that dependency. Configure public usage requirements and package exports accordingly.
Avoid fixing one target with global compiler flags unless the vendor explicitly requires them. A local workaround can leave another component or downstream package broken.
5. Separate shell setup from runtime library injection
Container builds and container startup are different environments. An entrypoint that sources setup scripts at startup normally does not configure earlier image-build instructions.
Likewise, an environment variable exported inside one build shell does not automatically become an exported variable in a later build shell. Source the required environment in the same instruction that performs the build, or persist suitable settings explicitly.
For a base image that already defines ROS_DISTRO and contains the corresponding installation, an illustrative build instruction is:
SHELL ["/bin/bash", "-c"]
RUN source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
colcon build --packages-select inspection_component
If the SDK provides its own documented environment script, apply it in that same shell where required. Do not assume a successful interactive session proves the build instruction has identical settings.
Keep these path mechanisms distinct:
- Compiler include paths locate headers.
- CMake package search settings locate dependency configuration files.
- Linker search paths locate libraries while creating binaries.
- Runtime loader settings locate shared libraries when binaries execute.
Some accelerated environments expose driver-related libraries only when a container runs. That can explain a later link or load problem, but those libraries do not replace missing SDK headers during compilation.
Use vendor-documented build-time development libraries or link stubs where applicable. Do not invent flags that suppress dependency checks or remove required functionality just to obtain a successful build.
6. Check image revisions, SDK versions and cached paths
If the expected development files are missing from a supplied image, verify the documented image contents and supported SDK-wrapper combination. Do not assume the camera wrapper, SDK and base image can be updated independently.
A mutable image tag may resolve to different contents over time. Record the image digest used for the failing build. If a corrected image is documented, pull it explicitly and rebuild the relevant stages, then record the replacement digest.
Refreshing a base image and disabling build-layer caching address different questions. The former checks the selected base contents; the latter reruns instructions. Neither repairs an incorrect include directory in the build configuration.
CMake caches can also preserve an old SDK location. After changing the installation prefix, inspect cached SDK paths and reconfigure the affected package in a clean build directory. Remove generated build artifacts only after confirming they contain no source files or required configuration.
For failures introduced by a dependency update, use the library-upgrade build-error checks to compare headers, libraries and discovery settings as a matched set.
7. Verify each repaired boundary separately
A successful header probe is useful, but it is not the final acceptance test. Verify the repair in increasing scope:
- Confirm the requested header exists in the failing image stage.
- Run a minimal preprocessing test with the intended compiler and include root.
- Confirm the real target's compiler command contains that root or an equivalent dependency setting.
- Rebuild the affected package and any consumers of its public headers.
- Check linking separately from runtime loading.
- Start the container using the documented runtime configuration, then test camera acquisition.
For example, preprocessing may pass while linking fails because SDK libraries are absent. Repair the library dependency without undoing the now-correct header path. Similarly, a binary that starts but cannot open a camera has crossed the compilation boundary; device access needs a separate diagnosis.
Prevent recurrence by making a build-only check independent of camera hardware. It should verify SDK discovery and compile a small supported example. Keep the hardware acquisition test separate so its failure does not obscure a development-package regression.
8. Confirm software support before selecting hardware
A missing header alone is not a reason to replace a camera or controller. First establish whether the intended SDK supports the operating system, processor architecture, compiler and deployment method.
When comparing area scan cameras, use the camera finder for hardware requirements, then verify the software compatibility separately. An interface match does not establish ROS 2 wrapper availability or container support.
The LS-CMR-0053 and LS-CMR-0166 are catalog candidates for a hardware shortlist. Their inclusion here does not establish compatibility with any particular SDK, wrapper or container image.
- Sensor format
- 1/1.7"
- Lens mount
- C-mount
- Interface
- GigE
- Resolution
- 12 MP
- Sensor format
- 1/1.7"
- Interface
- USB3
- Resolution
- 12 MP
- Shutter
- Rolling
For vision controllers, confirm the intended operating system and processor architecture before transferring a working development image. A successful build on another machine is not proof of binary compatibility.
The development-environment selection guide helps organize these software requirements before committing to a hardware platform.
9. Use a short handover checklist
Before closing the issue, save enough evidence for another engineer to reproduce the repair:
- Base image digest: identifies the actual starting filesystem.
- SDK and wrapper releases: records the dependency combination being built.
- Development-file location: proves the requested header exists inside the builder stage.
- Compiler command: shows the include root used by the failing target.
- Environment setup: identifies scripts and variables required during configuration and compilation.
- Runtime requirements: separates injected libraries and device access from build dependencies.
- Clean-build result: confirms the repair does not depend on an old cache or manual container changes.
When the software requirements are settled, use the camera configurator to continue hardware selection. If compatibility remains unclear, send the first compiler diagnostic, image identity and SDK requirements through application support before choosing parts.
The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.
Questions
Why does the build miss a header that exists on the host?
The compiler uses files available inside its current container build stage. A host SDK installation is separate unless the build explicitly receives those files through an appropriate mechanism. Install the authorized development package in the builder stage and verify its location there, rather than relying on an interactive container mount.
Can a runtime library path fix a missing SDK header?
Not by itself. A runtime library search path helps the loader find shared libraries after a program has been built. Header discovery belongs to preprocessing and compilation. Check the SDK development files and the target's include directories before investigating linker or runtime loader settings.
Should a development container image always include camera SDK headers?
Only if the relevant development files are actually included. An image can contain compilers and general development tools while lacking a particular SDK component. Check the documented image contents and inspect the exact header inside the stage running the build before changing application code.
What should I check when the header exists but compilation still fails?
Check the include spelling and capitalization, then compare the requested relative path with the compiler's search roots. Also inspect symbolic links and file permissions. If a standalone preprocessing test succeeds, compare its compiler and arguments with the command used for the failing source file.
Does a successful container build prove that camera acquisition will work?
No. Compilation verifies only part of the integration. The binary must still link against compatible libraries, load them in the runtime environment and access the camera through a supported configuration. Validate those stages separately and record the SDK, wrapper and image versions used.

