Hello, I am searching where the rpicam-apps build library files are installed, and in the processs i came across this post.
I am also following a similar path as you, trying to get things build using cmake file. I'm a beginner at it, so there are still a lot of things to pick up.
I noticed in your CMake file, you haven't linked the object files from Rpicam.
target_link_libraries(simple-cam rpicam-apps.so) << add something like this ?
target_link_libraries(simple-cam PkgConfig::rpicam-apps) << or add something like this ?
I also wonder if you know where the installed rpicam-apps library files are , ( if you do, can you please share the path directory as an example )
hopefully someone may guide us to link or search for the rpicam soon
Edit:
After making the above post, i begin to search how to find the libary.
1. in the command terminal, type " ldconfig -p " , it should list all the object files.
2. find the object file name with "rpicam_app.so.x.x.x". In my case, it looks like the following3. since i am compiling for raspberry pi, i used the path /lib/aarch64-linux-gnu/rpicam_app.so.1.4.3
4. in your cmake list file, you need to include this library, like the following
[/color]
5. Afterwards, you can try to cmake the file and make the build file. It compiled successfully on my side.
I am also following a similar path as you, trying to get things build using cmake file. I'm a beginner at it, so there are still a lot of things to pick up.
I noticed in your CMake file, you haven't linked the object files from Rpicam.
Code:
cmake_minimum_required(VERSION 3.6)project(SimpleCamDESCRIPTION "A small and documented example application for libcamera"LANGUAGES CXX)set (CMAKE_CXX_STANDARD 17)set (CMAKE_CXX_FLAGS "-Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -Wno-unused-parameter")find_package(PkgConfig)find_package(OpenCV REQUIRED)pkg_check_modules(LIBCAMERA REQUIRED IMPORTED_TARGET libcamera)message(STATUS "libcamera library found:")message(STATUS " version: ${LIBCAMERA_VERSION}")message(STATUS " libraries: ${LIBCAMERA_LINK_LIBRARIES}")message(STATUS " include path: ${LIBCAMERA_INCLUDE_DIRS}")# libevent is used specifically by simple-cam as its event loop.# Applications may use a different event handling implementation.pkg_check_modules(LIBEVENT REQUIRED IMPORTED_TARGET libevent_pthreads)message(STATUS "libevent_pthreads library found:")message(STATUS " version: ${LIBEVENT_VERSION}")message(STATUS " libraries: ${LIBEVENT_LINK_LIBRARIES}")message(STATUS " include path: ${LIBEVENT_INCLUDE_DIRS}")include_directories(${CMAKE_SOURCE_DIR} ${LIBCAMERA_INCLUDE_DIRS} ${LIBEVENT_INCLUDE_DIRS})include_directories("/home/pi/libcamera/include")include_directories("/home/pi/rpicam-apps")add_executable(simple-cam rpicam_hello.cpp)target_link_libraries(simple-cam ${OpenCV_LIBS})target_link_libraries(simple-cam PkgConfig::LIBEVENT)target_link_libraries(simple-cam PkgConfig::LIBCAMERA)target_link_libraries(simple-cam rpicam-apps.so)target_link_libraries(simple-cam PkgConfig::rpicam-apps)
target_link_libraries(simple-cam PkgConfig::rpicam-apps) << or add something like this ?
I also wonder if you know where the installed rpicam-apps library files are , ( if you do, can you please share the path directory as an example )
hopefully someone may guide us to link or search for the rpicam soon
Edit:
After making the above post, i begin to search how to find the libary.
1. in the command terminal, type " ldconfig -p " , it should list all the object files.
2. find the object file name with "rpicam_app.so.x.x.x". In my case, it looks like the following
Code:
admin@raspberrypi:~ $ ldconfig -p1518 libs found in cache `/etc/ld.so.cache'..... rpicam_app.so.1.4.3 (libc6,AArch64) => /usr/local/lib/aarch64-linux-gnu/rpicam_app.so.1.4.3 rpicam_app.so.1.4.3 (libc6,AArch64) => /lib/aarch64-linux-gnu/rpicam_app.so.1.4.3.....
4. in your cmake list file, you need to include this library, like the following
Code:
target_link_libraries(simple-cam /usr/local/lib/aarch64-linux-gnu/rpicam_app.so.1.4.3)
5. Afterwards, you can try to cmake the file and make the build file. It compiled successfully on my side.
Statistics: Posted by SavageGreed — Thu Mar 21, 2024 1:43 am