Gtk with Eclipse to cross compile for VF61


I have Col VF61 and I am trying to run a Gtk applicaiton on it. I have downloaded and installed the toolchain. Just to confirm that everything is ok, I compiled a demo gtk file from terminal by running below commands:

cd /usr/local/oecore-x86_64
. environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi

CC gtk.c -o gtk `/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/pkg-config --cflags gtk+-2.0` `/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/pkg-config --libs gtk+-2.0`


#include <gtk/gtk.h>
int main( int   argc,char *argv[] )
 GtkWidget *window;
 gtk_init (&argc, &argv);
 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 gtk_widget_show  (window);
 gtk_main ();
 return 0;

This was running fine on Col VF61. Then I started my eclipse from the same terminal and added the compiler commands and flags as per this forum post. Including only the compiler, I was able to compiler simple c program but when I included the gtk libraries, it gave me below errors:

Here is the full log:

/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/lib/arm-angstrom-linux-gnueabi/gcc/arm-angstrom-linux-gnueabi/6.2.1/include-fixed/limits.h:168:61: error: no include path in which to search for limits.h
#include_next <limits.h> /* recurse down to the real one */

Looks like, the file which is present at the directory mentioned above is giving error at line 168 which says that it is not able to find the limits.h, although the file limts.h is present in /usr/include. And same error for time.h

/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/glib-2.0/glib/gtypes.h:35:18: fatal error: time.h: No such file or directory
#include <time.h>

Please help. Thanks.

I have resolved the issue by manually adding the libraries to the project. I ran the command /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/pkg-config --cflags gtk+-2.0 and it showed all the include directories. I added these directories path into the project properties and same for the libraries /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/pkg-config --libs gtk+-2.0. It compiled succesfully.

Can you recheck using instructions from this post?. I changed the settings slightly with the --sysroot now being specified before the call to pkg-config. You can also find my sample Eclipse gtk3 project here. Also please note that you can ignore the errors and check if the actual compilation is successful.