MessageDialog error no matching function for call

My gtk version on Ubuntu is 3.24.20

I selected the same version through this page Programming with gtkmm 4 - GNOME Developer Center

I used this example for for MessageDialog MessageDialog

When I ran the code as it is, as standalone application it works fine

But when I insert the code inside a bigger application, used Show Question MessageDialog code only

I inserted these headers

#include <gtkmm/messagedialog.h>
#include <iostream>

also in the .cpp where the MessageDialog is being called

Documentation of gtkmm3 also has this MessageDialog gtkmm: Gtk::MessageDialog Class Reference

Everything I am using as mentioned in the example but still then I get his error on the line where I use MessageDialog

error: no matching function for call to ‘Gtk::MessageDialog::MessageDialog(CameraGrid&, const char [16], bool, Gtk::MessageType, Gtk::ButtonsType)

Can anyone guide what is going wrong here?

Is CameraGrid really a gtk::window?

CameraGrid is a Gtk::Grid type

There is no MessageDialog method that takes a grid type.

Remove it from the parameters.

Thank You. Did what you said, remove it from the Grid class sent a signal to the window class to call the Dialog it works fine now

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.