[gtkmm] string to ustring conversion problems



Hello,

I'm having trouble with Glib::ustring -> std::string implicit conversion.
According to the documentation (and source code), this should be a
completely automated process, but it's failing for me, no idea why.

Consider the following simple, test program:

#include <string>
#include <gtkmm.h>

int
main(void)
{
    std::string str = "A test string";
    Glib::ustring ustr(str);
}

And this happens while building it:

$ c++ test.cc -o test `pkg-config gtkmm-2.0 --cflags --libs`
/var/tmp/cchj4soz.o: In function `main':
/var/tmp/cchj4soz.o(.text+0x28): undefined reference to `Glib::ustring::ustring(basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> > const &)'

(note that glibmm is beeing linked properly, i.e., pkg-config gives the
right flags)

I've got another person to try the same thing under a Debian system, and
this same code works fine.

In order to make it work, I must do something like:

    std::string str = "A test string";
    Glib::ustring ustr;
    ustr.assign(str.c_str());

which is very ugly.

Tried with gcc 3.2.1 and gcc 2.95 (the later, the default in NetBSD).

My gtkmm version is 2.2.0.

Any idea what can be happening?

Thank you.

-- 
Julio M. Merino Vidal <jmmv menta net>
The NetBSD Project - http://www.NetBSD.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]