Skip to main content
Associate II
November 4, 2025
Solved

"Compilation Error: Missing limits.h Header in Cross-Compilation for GStreamer HelloWorld Example"

  • November 4, 2025
  • 2 replies
  • 426 views

 

Description:

When attempting to compile a GStreamer "Hello World" example (basic-tutorial-1.c) using the cross-compiler toolchain on STM32MP1 with OpenSTLinux, a fatal error occurs indicating that the limits.h header file is missing.

https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html?gi-language=c

 

Steps to Reproduce:

  1. Source the environment setup script:

     
    source /opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
  2. Check the cross-compiler:

     
    echo $CC
    arm-ostl-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
  3. Attempt to compile the program:

     
    arm-ostl-linux-gnueabi-gcc -Wall basic-tutorial-1.c -o helloworld $(pkg-config --cflags --libs gstreamer-1.0)

Error Message:

/opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/13.3.0/include/limits.h:205:15: fatal error: limits.h: No such file or directory
205 | #include_next <limits.h> /* recurse down to the real one */ compilation terminated.

 

Best answer by SullyNiu

I finally figured it out

$CC basic-tutorial-1.c -o basic-tutorial-1 -I/opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/gstreamer-1.0 -I/opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/glib-2.0 -I/opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib/glib-2.0/include -lgstreamer-1.0 -lglib-2.0

Refer to this repository: https://github.com/STMicroelectronics/st-openstlinux-application/blob/main/touch-event-gtk-player/Makefile.sdk

2 replies

Andrew Neil
Super User
November 4, 2025

So do you actually have a limits.h file in your filesystem?

If you do, is it in a place where your compiler is looking? ie, somewhere covered by your Include Paths ?

 

PS:

Gstreamer has a forum here: https://discourse.gstreamer.org/ 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
SullyNiuAuthor
Associate II
November 5, 2025

I think these should be included in the cross-compilation toolchain, since the system is using gst-launch-1.0.

SullyNiu_0-1762307555105.png

 

SullyNiuAuthorBest answer
Associate II
November 5, 2025

I finally figured it out

$CC basic-tutorial-1.c -o basic-tutorial-1 -I/opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/gstreamer-1.0 -I/opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/glib-2.0 -I/opt/st/stm32mp1/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib/glib-2.0/include -lgstreamer-1.0 -lglib-2.0

Refer to this repository: https://github.com/STMicroelectronics/st-openstlinux-application/blob/main/touch-event-gtk-player/Makefile.sdk

November 5, 2025

The compilation error indicates that the limits.h header file is missing during cross-compilation for the GStreamer HelloWorld example. 

 
 
 
Andrew Neil
Super User
November 5, 2025

@unknown wrote:

The compilation error indicates that the limits.h header file is missing


Not necessarily missing: As I said earlier, it could be present but not in a place where the compiler is looking.

In fact, I think this is the more common case?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.