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>
d
int main(int argc,
char *argv[]) {
const gchar *nano_str;
guint major, minor, micro, nano;
gst_init (&argc, &argv);
gst_version (&major, &minor, µ, &nano);
if (nano == 1)
nano_str = "(CVS)";
else if (nano == 2)
nano_str = "(Prerelease)";
else
nano_str = "";
printf ("This program is linked against GStreamer %d.%d.%d %s\n",
major, minor, micro, nano_str);
return 0;
}
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.
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:
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.