cmauri / eviacam

webcam based mouse emulator
GNU General Public License v3.0
145 stars 38 forks source link

Conflicting declarations of GdkWindow from gtk and wx #25

Closed adrianmay closed 4 years ago

adrianmay commented 4 years ago

On arch linux I'm getting:

In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gdk/gdkx.h:28,
                 from wxappbar.cpp:46:
/usr/include/gtk-3.0/gdk/gdktypes.h:143:39: error: conflicting declaration ‘typedef struct _GdkWindow GdkWindow’
  143 | typedef struct _GdkWindow             GdkWindow;
      |                                       ^~~~~~~~~
In file included from /usr/include/wx-3.0/wx/wxprec.h:12,
                 from wxappbar.cpp:24:
/usr/include/wx-3.0/wx/defs.h:3466:33: note: previous declaration as ‘typedef struct _GdkDrawable GdkWindow’

The problem remains after removing arch's package wxgtk3 and leaving only 2. I can't remove gtk3 without wrecking my box.

checking gtk version... 3.24.13
checking wxWidgets version... 3.0.4
checking opencv version... 4.2.0
adrianmay commented 4 years ago

Just tried it with wxWidgets 3.1.3 from source. Same result. Perhaps you're just not supposed to include both of those headers.

adrianmay commented 4 years ago

The problem turned out to be that wxWidgets had been compiled against gtk2, not 3. Now I'm just dusting away warnings which become errors under gcc 9.2

adrianmay commented 4 years ago
index 26f1a25..8b3c650 100755
--- a/src/viacamcontroller.cpp
+++ b/src/viacamcontroller.cpp
@@ -230,7 +230,7 @@ CCamera* CViacamController::SetUpCamera()

                        wxSingleChoiceDialog choiceDlg(
                                NULL, _("Choose the camera to use"), _T("Enable Viacam"), strArray, 
-                               (char**)NULL, wxDEFAULT_DIALOG_STYLE | wxOK | wxCANCEL | wxCENTRE);
+                               NULL, wxDEFAULT_DIALOG_STYLE | wxOK | wxCANCEL | wxCENTRE);

                        if (choiceDlg.ShowModal ()!= wxID_OK) return NULL;
Gab0 commented 4 years ago

Hi, I'm getting the exact same error here, also under Arch Linux. How did you solve that?