Hello,
I am working on IMX8MQEVK board, using Linux BSP L4.14.98_2.0.0. I wanted to cross-compile gstreamer application from linux host system. Since native aarch64-linux-gnu-gcc is unable to find gstreamer-1.0 libraries, I decided build the SDK with required libraries using bitbake fsl-image-validation-imx -c populate_sdk. I added the meta-gstreamer1.0 layer from sumo branch to source and in bblayer.conf file and as instructed in linux users giude, added following code to local.conf:
IMAGE_INSTALL_append += "gstreamer1.0-rtsp-server gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav"
LICENSE_FLAGS_WHITELIST = "commercial"
The sdk was built succesfully and I installed it to /opt/fsl-image destination but now when I used aarch64-poky-linux-gcc app.c -o app_arm `pkg-config --cflags --libs gstreamer-1.0`, I get the following error:
In file included from /opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/include-fixed/syslimits.h:7:0,
from /opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/include-fixed/limits.h:34,
from /opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/lib/glib-2.0/include/glibconfig.h:11,
from /opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/include/glib-2.0/glib/gtypes.h:32,
from /opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/include/glib-2.0/glib/galloca.h:32,
from /opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/include/glib-2.0/glib.h:30,
from /opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/include/gstreamer-1.0/gst/gst.h:27,
from basic_tut1.c:1:
/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/include-fixed/limits.h:194:61: error: no include path in which to search for limits.h
#include_next <limits.h> /* recurse down to the real one */
^
In file included from /opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/include/glib-2.0/glib/galloca.h:32:0,
from /opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/include/glib-2.0/glib.h:30,
from /opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/include/gstreamer-1.0/gst/gst.h:27,
from basic_tut1.c:1:
/opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/include/glib-2.0/glib/gtypes.h:35:10: fatal error: time.h: No such file or directory
#include <time.h>
^~~~~~~~
compilation terminated.
I tried rebuilding the SDK, the same error repeated. I will also try it with warrior branch since zeus branch gives error with gstreamer. Meanwhile Please help me resolve the issue or provide an alternative to allow cross-compliation of gstreamer applications from x86_64 host to arm64 target imx8mqevk machine.
Thank you
解決済! 解決策の投稿を見る。
Hello,
I ended up solving my problem and it was an issue in the linker file in the built SDK. I used GNU toolchain along with the libraries from sumo build
aarch64-linux-gnu-gcc --sysroot=/home/gavy0197/imx/toolchain/sysroots/aarch64-poky-linux -L/home/gavy0197/imx/toolchain/sysroots/aarch64-poky-linux/usr/lib/ gtsream_app.c -o gtsream_app_arm `pkg-config --cflags --libs gstreamer-1.0`
I added -L"folder to gstreamer library" and changed the sysroot directory to where the correct linker script and all the required header files were located. I really thought it would be smoother than this but I hope it helps someone who has a similar query.
Hello,
I ended up solving my problem and it was an issue in the linker file in the built SDK. I used GNU toolchain along with the libraries from sumo build
aarch64-linux-gnu-gcc --sysroot=/home/gavy0197/imx/toolchain/sysroots/aarch64-poky-linux -L/home/gavy0197/imx/toolchain/sysroots/aarch64-poky-linux/usr/lib/ gtsream_app.c -o gtsream_app_arm `pkg-config --cflags --libs gstreamer-1.0`
I added -L"folder to gstreamer library" and changed the sysroot directory to where the correct linker script and all the required header files were located. I really thought it would be smoother than this but I hope it helps someone who has a similar query.
4.14.98 includes gstreamer already, after you build the yocto bsp accroding to the yocto user guide, you can get the gstreamer libary already you don't need to cross compile it
Hello Joanxie,
I found the gstreamer libraries in the build, but they only allow me to work with gst functions on command-line. I however wanted to build an application that could allow me to switch between two cameras and record and playback video using interactive interface. Hence, I wanted to cross compile the application from linux host machine for imx8m device. Is there a BSP version which is works well for creating SDK for gstreamer as I saw many discussions stating that when building the toolchain or SDK, the library linkers often point to host lib folder, causing issues while cross compiling.