I am trying to make our application work on an Arm device, specs:
Architecture: aarch64
Byte Order: Little Endian
Model name: ARMv8 Processor rev 3 (v8l)
and for this I have installed the necessary cross compiler
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
and since we use Qt, I also cross compiled Qt for this specific architecture:
./configure -xplatform linux-aarch64-gnu-g++ -opensource \
-confirm-license -nomake tests -nomake examples -static \
-skip qtwebengine -release -prefix /opt/qt5-arm -no-xcb \
-no-opengl -no-use-gold-linker
Our application links with video for linux so we have the following compile line:
aarch64-linux-gnu-g++ -o bin/executable <removed unimportant stuff>...
-lv4l2 -lv4lconvert -L/opt/qt5-arm/plugins/imageformats -lqgif
-L/opt/qt5-arm/lib -lqicns -lqico -lqjpeg -lQt5DBus
-lQt5Gui -lqtlibpng -lqtharfbuzz -lQt5Network -lQt5Core
-lm -lqtpcre2 -ldl -lpthread
And since I did not cross compile video for linux obviously I have got the following error message:
/usr/bin/aarch64-linux-gnu-ld: cannot find -lv4l2
/usr/bin/aarch64-linux-gnu-ld: cannot find -lv4lconvert
collect2: error: ld returned 1 exit status
and here comes the question:
From where do I get the sources for video4linux, and how do I cross compile them for my architecture? Please note, I have found something which is named v4l-utils from https://www.linuxtv.org/downloads/ but:
- it requires to link with libudev (which is not present in the cross compiled libraries' directory and I have no idea from where to get it)
- I don't think it's what I require :)
Thanks for the help
ldis not able to find the v4l package, you need to install the package in your build system or download the package manually and provide the path.After installing the package if you type command
which v4l2it will provide the path where it's installed from that you will know you have the library that is needed.You can download the package from this site as well. https://packages.debian.org/sid/v4l-utils
Source code for the v4l2 its part of the linux kernel driver v4l2