我正在尝试在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;
}


请帮帮我...谢谢

最佳答案

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

#define SRCDIR


main()之前。

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

10-08 20:01