GNOME Bugzilla – Bug 576069
Call to Gtk::Builder::create_from_file is ambiguous
Last modified: 2009-03-20 12:01:07 UTC
Calling Gtk::Builder::create_from_file() with two string literals is ambiguous and causes a compiler error. The line Gtk::Builder::create("foo", "bar"); produces foo.cpp:5: error: call of overloaded ‘create_from_file(const char [4], const char [4])’ is ambiguous /usr/include/gtkmm-2.4/gtkmm/builder.h:187: note: candidates are: static Glib::RefPtr<Gtk::Builder> Gtk::Builder::create_from_file(const std::string&, const Glib::ustring&) /usr/include/gtkmm-2.4/gtkmm/builder.h:202: note: static Glib::RefPtr<Gtk::Builder> Gtk::Builder::create_from_file(const std::string&, const Glib::StringArrayHandle&) I'm using g++ 4.3.3. The same line compiles fine on Windows using MinGW with g++ 3.4.5. I think the problem is because of this ArrayHandle constructor: template <class Cont> inline ArrayHandle(const Cont& container); Can we somehow "hide" it from being seen if Cont is not a container type, to prevent the compiler from trying implicit conversions which would not work anyway?
I fixed this already in recent versions of gtkmm.