0

我正在尝试在 ios 中编译 glib,但在 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;
}

请帮帮我...谢谢

4

1 回答 1

0

我无法根据给定的信息弄清楚您如何尝试在 ios 中编译示例代码,但您可以添加

#define SRCDIR

之前main()

示例代码似乎glib/gio/tests/appinfo-test.c在源存储库中。SRCDIR定义-DSRCDIR=\""$(srcdir)"\"Makefile.am.

于 2012-08-19T01:33:46.773 回答