0

I am trying to compile glib in ios, i have got an error in gio/tests/appinfo-test.h

#include <stdlib.h>
#include <gio/gio.h>
int 
main (int argc, char *argv[])
{
  const gchar *envvar;
  gint pid_from_env;
  envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE_PID");
  g_assert (envvar != NULL);
  pid_from_env = atoi (envvar);
  g_assert_cmpint (pid_from_env, ==, getpid ());

  envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE");
  g_assert_cmpstr (envvar, ==, SRCDIR "/appinfo-test.desktop"); //got the error here that "Use of undefined identifier 'SRCDIR' "
  return 0;
}

please help me out...Thank you

Yasushi Shoji
  • 4,028
  • 1
  • 26
  • 47
Karthik
  • 113
  • 1
  • 10

1 Answers1

0

I can not figure out with given information how you tried to compile the sample code in your ios, but you can add

#define SRCDIR

before main().

The sample code seems to be glib/gio/tests/appinfo-test.c in the source repository. SRCDIR is defined as -DSRCDIR=\""$(srcdir)"\" in the Makefile.am.

Yasushi Shoji
  • 4,028
  • 1
  • 26
  • 47