LCCV icon indicating copy to clipboard operation
LCCV copied to clipboard

make fails

Open johncblacker opened this issue 1 year ago • 5 comments

Trying to perform make and get the following error: In file included from /home/pi/cpp-projects/LCCV/include/lccv.hpp:9, from /home/pi/cpp-projects/LCCV/src/lccv.cpp:1: /home/pi/cpp-projects/LCCV/include/libcamera_app.hpp:53:33: error: ‘StreamRoles’ in namespace ‘libcamera’ does not name a type; did you mean ‘StreamRole’? 53 | using StreamRoles = libcamera::StreamRoles; | ^~~~~~~~~~~ | StreamRole compilation terminated due to -Wfatal-errors. make[2]: *** [CMakeFiles/liblccv.dir/build.make:82: CMakeFiles/liblccv.dir/src/lccv.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/liblccv.dir/all] Error 2

Did I miss doing something in prep?

johncblacker avatar Aug 14 '23 21:08 johncblacker

I perused the libcamera repo and found that "StreamRoles" was basically an alias for StreamRole and was removed because "it is no longer strictly necessary." Therefore, I would surmise that references to "StreamRoles" be changed to "StreamRole" instead and line 53 in the source can be deleted. I'm going to give that a shot and see what happens.

johncblacker avatar Aug 15 '23 15:08 johncblacker

The "fix" I came up with is: 1.) Remove line 84 in libcamera_app.cpp 2.) Change line 85 in libcamera_app.cpp to: configuration_ = camera_->generateConfiguration({StreamRole::StillCapture, StreamRole::Raw}) ; 3.) Remove line 129 in libcamera_app.cpp 4.) Change line 130 in libcamera_app.cpp to: configuration_ = camera_->generateConfiguration({ StreamRole::Viewfinder });

5.) Remove line 53 in libcamera_app.hpp

Also, I added: link_directories(/usr/local/lib/arm-linux-gnueabihf) immediately following the Include_directories statement in the CMakeLists.txt so that the build would find the requisite libcamera libraries for linker. (verify on your system) My libcamera version is 0.0.5 on raspberry pi 4b bullseye 32-bit.

johncblacker avatar Aug 16 '23 14:08 johncblacker

Everything worked without problem a few weeks ago, but yesterday while rebuilding LCCV I hit this problem. So I assume something changed in libcamera headers in an update (apt-get update/upgrade). My solution was to change line 53 in libcamera-app to using StreamRoles = std::vectorlibcamera::StreamRole; which matches libcamera-app.hpp in https://github.com/raspberrypi/libcamera-apps. It now compiles and works for my small program

chrisd-mso avatar Aug 18 '23 22:08 chrisd-mso

Added a PR @kbarni

bjajoh avatar Aug 25 '23 17:08 bjajoh

@bjajoh thanks for the PR, will test it and merge later this week.

kbarni avatar Aug 28 '23 09:08 kbarni