3

我的 .pro 文件中有以下配置

INCLUDEPATH += /home/vickey/ossbuild-read-only/Shared/Build/Linux/x86/include/glib-2.0/
CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-0.10
LIBS            += -L/usr/lib `pkg-config --cflags --libs gstreamer-0.10`
LIBS        += -L. -L/usr/lib -lphonon -lcurl -ltag -fopenmp -lsayonara_gstreamer

当我尝试构建项目时,出现以下错误

/home/vickey/src/player/../../../../ossbuild-read-only/Shared/Build/Linux/x86/include/glib-2.0/glib/gthread.h:-1: In function 'gboolean g_once_init_enter(volatile gsize*)':

/home/vickey/src/player/../../../../ossbuild-read-only/Shared/Build/Linux/x86/include/glib-2.0/glib/gthread.h:348: error: size of array is negative

双击错误将我带到 gthread.h 文件,并指出以下行

g_once_init_enter (volatile gsize *value_location)
{
  if G_LIKELY ((gpointer) g_atomic_pointer_get (value_location) != NULL)
    return FALSE;
  else
    return g_once_init_enter_impl (value_location);
}

似乎是什么问题?

4

1 回答 1

0

为 64 位平台编译古老的 glib 和 pango 时出现相同的错误。

以下是g_atomic_pointer_get该版本中源代码的外观:

# define g_atomic_pointer_get(atomic) \
 ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \
  (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void *) (atomic)))

所以,这里atomicgsize,它必须与 相同sizeofgpointervoid*

它帮助我重新定义gsizegssizeglibconfig.h.

也更新GLIB_SIZEOF_VOID_P,GLIB_SIZEOF_LONGGLIB_SIZEOF_SIZE_T.

于 2018-03-21T07:01:43.440 回答