Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make fails #22

Open
johncblacker opened this issue Aug 14, 2023 · 5 comments
Open

make fails #22

johncblacker opened this issue Aug 14, 2023 · 5 comments

Comments

@johncblacker
Copy link

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
Copy link
Author

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
Copy link
Author

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.

@chrisd-mso
Copy link

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

@bjajoh
Copy link
Contributor

bjajoh commented Aug 25, 2023

Added a PR @kbarni

@kbarni
Copy link
Owner

kbarni commented Aug 28, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants