Apalis TK1 GStreamer error build

I want to make program, that grabs video from CSI camera module with gstreamer library. I try examples from official site (GStreamer). I have a compiling error, there’s no file “glib.h”. What it can be? Are there some examples of code for TK1 to grab video?

11:26:58 **** Incremental Build of configuration Release for project example_csi ****
make all 
Building file: ../src/example_csi.c
Invoking: Cross GCC Compiler
arm-angstrom-linux-gnueabi-gcc  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -O3 -Wall -O2 -pipe -g -feliminate-unused-debug-types  -c -MMD -MP -MF"src/example_csi.d" -MT"src/example_csi.o" -o "src/example_csi.o" "../src/example_csi.c"
In file included from ../src/example_csi.c:16:0:
/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/glib-2.0/glib.h:30:10: fatal error: glib/galloca.h: No such file or directory
 #include <glib/galloca.h>
compilation terminated.
make: *** [src/subdir.mk:20: src/example_csi.o] Ошибка 1

11:27:23 Build Failed. 2 errors, 0 warnings. (took 25s.33ms)

Source code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#include <glib-2.0/glib.h>
#include <gstreamer-0.10/gst/gst.h>


int main(int   argc,
	      char *argv[]) {
	const gchar *nano_str;
	  guint major, minor, micro, nano;
	  gst_init (&argc, &argv);

	  gst_version (&major, &minor, &micro, &nano);

	  if (nano == 1)
	    nano_str = "(CVS)";
	  else if (nano == 2)
	    nano_str = "(Prerelease)";
	    nano_str = "";

	  printf ("This program is linked against GStreamer %d.%d.%d %s\n",
	          major, minor, micro, nano_str);

	  return 0;

What exact toolchain/SDK are you using?


Where you got this toolchain? Could you provide a link?

from Getting Started Guide

I’ve tried to include gstreamer from my host system to project, configurated for cross compile, it give following error:

/usr/include/glib-2.0/glib/gtypes.h: In function ‘_GLIB_CHECKED_ADD_U64’:
/usr/include/glib-2.0/glib/gtypes.h:423:3: error: size of array ‘_GStaticAssertCompileTimeAssertion_0’ is negative
   G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));

As i understand, gstreamer is platform-specific, and i can’t take from another place, except from the sdk, provided by toradex?

You are right. You need to use the gstreamer version for arm. Could you look for the file glib.h in the SDK folder? If it is not there, then you will need to create a custom SDK file for you.

I found only in this folder:


Threre’s no “glib.h” in:


Is there manual how to create sdk?


The error which gets reported complains about the missing glib/galloca.h file.
This can be fixed by adding the required include paths for the glib-2.0 package.

One way to do this is to by using pkg-config output, e.g. adding the following to your compiler call, note the back-ticks which first execute the program and then inserts the program output into the compiler cmdline:

`pkg-config --cflags glib-2.0`

So that the above cmdline becomes:

arm-angstrom-linux-gnueabi-gcc  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -O3 -Wall -O2 -pipe -g -feliminate-unused-debug-types `pkg-config --cflags glib-2.0` -c -MMD -MP -MF"src/example_csi.d" -MT"src/example_csi.o" -o "src/example_csi.o" "../src/example_csi.c"

Likely you need additonally add to the linker flags a similar call:

`pkg-config --libs glib-2.0`

While trying this out I found that the gstreamer 0.10 header files are actually missing in the released SDK, so you get an error at '#include '. I’m still working on why this happened and how to work around it.



My bad. I did mix up paths and checked for gstreamer 0.10 in a SDK for an i.MX device which does not have them.

With the right sysroot path for apalis-tk1 in my installation and by adding gstreamer-0.10 to pkg-config it compiles and then links for me.

arm-angstrom-linux-gnueabi-gcc  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -O3 -Wall -O2 -pipe -g -feliminate-unused-debug-types `pkg-config --cflags glib-2.0 gstreamer-0.10` -c -MMD -MP -MF"src/example_csi.d" -MT"src/example_csi.o" -o "src/example_csi.o" "../src/example_csi.c"

arm-angstrom-linux-gnueabi-gcc  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -O3 -Wall -O2 -pipe -g -feliminate-unused-debug-types `pkg-config --libs glib-2.0 gstreamer-0.10` -o src/example_csi src/example_csi.o

file src/example_csi  
   src/example_csi: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.1.10, BuildID[sha1]=22e48f567e5abb1307e76cce6ecf1f33ec166faa, with debug_info, not stripped