lit-robotics / libcamera-rs

Experimental Rust bindings for libcamera
Apache License 2.0
46 stars 15 forks source link

Unable to build throwing `FileDescriptor has no member named get’ #32

Open tgmichel opened 1 year ago

tgmichel commented 1 year ago

While trying to crosscompile libcamera-rs (56e2442986bdc4d9be89193bb72254ae8cf969ff) for armv7-unknown-linux-gnueabihf (raspberry) I get:

  running: "arm-linux-gnueabihf-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=armv7-a" "-mfpu=vfpv3-d16" "-I" "/usr/arm-linux-gnueabihf/usr/local/include/libcamera" "-Wall" "-Wextra" "-std=c++17" "-o" "/path-to/target/armv7-unknown-linux-gnueabihf/release/build/libcamera-sys-66bb967bde9a6220/out/c_api/framebuffer.o" "-c" "c_api/framebuffer.cpp"
  cargo:warning=c_api/framebuffer.cpp: In function ‘libcamera_frame_metadata_planes_t* libcamera_frame_metadata_planes(libcamera_frame_metadata_t*)’:

  cargo:warning=c_api/framebuffer.cpp:19:91: error: no match for call to ‘(std::vector<libcamera::FrameMetadata::Plane>) ()’

  cargo:warning=   19 |     return new libcamera::Span<libcamera::FrameMetadata::Plane>(std::move(metadata->planes()));

  cargo:warning=      |                                                                           ~~~~~~~~~~~~~~~~^~

  cargo:warning=c_api/framebuffer.cpp: In function ‘int libcamera_framebuffer_plane_fd(libcamera_framebuffer_plane_t*)’:

  cargo:warning=c_api/framebuffer.cpp:50:22: error: ‘class libcamera::FileDescriptor’ has no member named ‘get’

  cargo:warning=   50 |     return plane->fd.get();

  cargo:warning=      |                      ^~~

  cargo:warning=c_api/framebuffer.cpp: In function ‘size_t libcamera_framebuffer_plane_offset(const libcamera_framebuffer_plane_t*)’:

  cargo:warning=c_api/framebuffer.cpp:54:19: error: ‘const libcamera_framebuffer_plane_t’ {aka ‘const struct libcamera::FrameBuffer::Plane’} has no member named ‘offset’

  cargo:warning=   54 |     return plane->offset;

  cargo:warning=      |                   ^~~~~~

So apparently there are some outdated API references on this project using libcamera v0.1.0? I've installed dependencies much like shown in the CI:

git clone https://git.libcamera.org/libcamera/libcamera.git --branch v0.1.0
meson setup build
ninja -C build install
chemicstry commented 1 year ago

Could it be that you have an older version of libcamera, installed by the package manager?

If you look at v0.1.0 code, the missing fields are there: https://github.com/kbingham/libcamera/blob/v0.1.0/include/libcamera/framebuffer.h#L57