How can I resolve a compilation error in dbusmessage.h using mingw through MSYS2?

36 Views Asked by At

I developed a program on linux which uses the gtkmm library. The code compiles successfully on linux platforms. I am attempting to compile it on Windows 10 using MSYS2 to obtain gcc and the gtkmm library.

During compilation, I receive errors while compiling the giomm dependency of gtkmm. It invokes dbusmessage.h, and I receive the following compilation error:

$ g++ main.cpp source/ControlWidget.cpp source/ControlWidget.h source/LaneWidget.cpp source/LaneWidget.h source/NameDialogue.cpp source/NameDialogue.h source/mainwindow.cpp source/mainwindow.h source/rs232.c source/rs232.h $(pkg-config --cflags --libs gtkmm-4.0) -o test.exe
In file included from C:/msys64/mingw64/include/windows.h:71,
                 from source/rs232.h:56,
                 from source/ControlWidget.h:14,
                 from source/mainwindow.h:14,
                 from main.cpp:1:
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:90:3: error: expected identifier before num
eric constant
   90 |   ERROR,
      |   ^~~~~
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:90:3: error: expected '}' before numeric co
nstant
In file included from C:/msys64/clang64/include/giomm-2.68/giomm/dbusmethodinvocation.h:26,
                 from C:/msys64/clang64/include/giomm-2.68/giomm/dbusconnection.h:29,
                 from C:/msys64/clang64/include/giomm-2.68/giomm/application.h:37,
                 from C:/msys64/clang64/include/gtkmm-4.0/gtkmm/application.h:32,
                 from main.cpp:2:
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:86:1: note: to match this '{'
   86 | {
      | ^
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:90:3: error: expected unqualified-id before
 numeric constant
   90 |   ERROR,
      |   ^~~~~
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:279:1: error: expected declaration before
}' token
  279 | } // namespace Gio
      | ^
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:286:34: error: 'CapabilityFlags' is not a m
ember of 'Gio::DBus'; did you mean 'Gio::CapabilityFlags'?
  286 | class GIOMM_API Value<Gio::DBus::CapabilityFlags> : public Glib::Value_Flags<Gio::DBus::Capa
bilityFlags>
      |                                  ^~~~~~~~~~~~~~~
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:242:12: note: 'Gio::CapabilityFlags' declar
ed here
  242 | enum class CapabilityFlags
      |            ^~~~~~~~~~~~~~~
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:286:49: error: template argument 1 is inval
id
  286 | class GIOMM_API Value<Gio::DBus::CapabilityFlags> : public Glib::Value_Flags<Gio::DBus::Capa
bilityFlags>
      |                                                 ^
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:286:89: error: 'CapabilityFlags' is not a m
ember of 'Gio::DBus'; did you mean 'Gio::CapabilityFlags'?
  286 | class GIOMM_API Value<Gio::DBus::CapabilityFlags> : public Glib::Value_Flags<Gio::DBus::Capa
bilityFlags>
      |                                                                                         ^~~~
~~~~~~~~~~~
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:242:12: note: 'Gio::CapabilityFlags' declar
ed here
  242 | enum class CapabilityFlags
      |            ^~~~~~~~~~~~~~~
C:/msys64/clang64/include/giomm-2.68/giomm/dbusmessage.h:286:104: error: template argument 1 is inva
lid
  286 | class GIOMM_API Value<Gio::DBus::CapabilityFlags> : public Glib::Value_Flags<Gio::DBus::Capa
bilityFlags>
      |
           ^

I have made sure all of my MSYS2 packages are up to date. Everything is at the latest version.

g++.exe version: 12.2.0 gtkmm version: 4.0

0

There are 0 best solutions below