簡體   English   中英

gtkmm標頭中的沖突聲明

[英]Conflicting declarations in gtkmm headers

我開始認為我需要廢棄一切並從頭開始重做。 我一直在代碼塊編譯器設置中手動添加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 ===|

關於如何解決這個問題的任何想法? 還有,關於如何將這些庫添加到庫的標准路徑的任何提示? 為每個項目手動執行此操作將是一個巨大的痛苦。

我解決了 而不是在編譯器的搜索目錄下添加頭目錄。 我添加了以下行:

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

到代碼塊中編譯器和鏈接器下的其他選項。 這解決了所有沖突,並允許我最終運行我的測試程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM