After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 576069 - Call to Gtk::Builder::create_from_file is ambiguous
Call to Gtk::Builder::create_from_file is ambiguous
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: build
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2009-03-20 11:49 UTC by Armin Burgmeier
Modified: 2009-03-20 12:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Armin Burgmeier 2009-03-20 11:49:24 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?
Comment 1 Murray Cumming 2009-03-20 12:01:07 UTC
I fixed this already in recent versions of gtkmm.