【问题标题】:Conflicting declarations in gtkmm headersgtkmm 标头中的冲突声明
【发布时间】:2013-04-18 09:20:52
【问题描述】:

我开始认为我需要废弃所有东西并从头开始重做。 我一直在代码块编译器设置中手动添加来自 GTK 和 gtkmm 的库,当我终于看到除了缺少标头之外的其他内容时,我明白了。

    ||=== test, Debug ===|
   /usr/include/gdkmm-3.0/gdkmm/applaunchcontext.h|32|error: conflicting declaration ‘typedef struct _GdkAppLaunchContext GdkAppLaunchContext’|
   /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h|42|error: ‘GdkAppLaunchContext’ has a previous declaration as ‘typedef struct GdkAppLaunchContext GdkAppLaunchContext’|
   /usr/include/gdkmm-3.0/gdkmm/applaunchcontext.h|33|error: conflicting declaration ‘typedef struct _GdkAppLaunchContextClass GdkAppLaunchContextClass’|
   /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h|43|error: ‘GdkAppLaunchContextClass’ has a previous declaration as ‘typedef struct GdkAppLaunchContextClass GdkAppLaunchContextClass’|
   /usr/include/gdkmm-3.0/gdkmm/rgba.h|251|error: return type ‘Gdk::RGBATraits::CType {aka struct _GdkRGBA}’ is incomplete|
   /usr/include/gdkmm-3.0/gdkmm/rgba.h|252|error: return type ‘Gdk::RGBATraits::CType {aka struct _GdkRGBA}’ is incomplete|
   /usr/include/gtkmm-3.0/gtkmm/widget.h|3890|error: ‘GdkEventTouch’ was not declared in this scope|
   /usr/include/gtkmm-3.0/gtkmm/widget.h|3890|error: template argument 2 is invalid|
   ||=== Build finished: 8 errors, 0 warnings ===|

关于如何解决这个问题的任何想法? 另外,关于如何将这些库添加到库的标准路径的任何提示?为每个项目手动执行此操作将非常痛苦。

【问题讨论】:

  • 由于 gtkmm 没有声明对我可以看到的 Code::Blocks 的任何支持,我建议使用不同的编译器/IDE。此页面live.gnome.org/gtkmm/MSWindows 提供了各种 Windows 环境的说明。
  • 我在 linux 下工作。
  • 我早该发现的,抱歉。
  • 不用担心 :)thanx 反正

标签: c++ codeblocks gtkmm glibmm


【解决方案1】:

我解决了。而不是在编译器的搜索目录下添加头目录。 我添加了以下行:

    `pkg-config --libs --cflags gtkmm-3.0`

代码块中编译器和链接器下的其他选项。这解决了所有冲突并最终让我运行我的测试程序。

【讨论】:

  • 那一行到底是在哪里添加的?
猜你喜欢
  • 1970-01-01
  • 2017-07-15
  • 2021-08-11
  • 1970-01-01
  • 1970-01-01
  • 2022-08-09
  • 1970-01-01
  • 1970-01-01
  • 2018-11-27
相关资源
最近更新 更多