我在我的C ++项目中添加了GTK库,出现了这个错误。我该如何解决这个问题?
此行发生错误:
line 84: GLIB_DEPRECATED_IN_2_54_FOR(g_object_new_with_properties and g_initable_init)
/usr/include/glib-2.0/gio/ginitable.h
。
从形式上看,
/usr/include/glib-2.0/gio/ginitable.h:84:58: error: identifier "and" is a special operator name in C++ [-Werror=c++-compat]
GLIB_DEPRECATED_IN_2_54_FOR(g_object_new_with_properties and g_initable_init)
我该如何解决?
除了添加@Ruslan建议的标志,考虑filing a bug report against GTK。虽然使用and
作为标识符确实是有效的C,但通过将名称更改为and_
或conjunction
或其他内容可以轻松避免这一点。
做前者会为你解决问题。做后者可能会解决每个人的问题......