Re: Strange error in using ThumbnailFactory::create()



On 10/10/07, Liangxu Wang <wlx mygis org> wrote:
> Hi,
>         I want to load the file's thumbnail, so Gnome::UI is used. The program
> can be compiled without any error, but can not start, with error:
> --------------
> GLib-ERROR **: The thread system is not yet initialized.
> aborting...
> --------------
> Code like this:
>
> #include <gtkmm.h>
> #include <libgnomeuimm.h>
> ----<snip>---
>         Glib::RefPtr<Gdk::Pixbuf> thumbnail;
>         Glib::RefPtr<Gnome::UI::ThumbnailFactory > th;
> //error with this line
> th=Gnome::UI::ThumbnailFactory::create(Gnome::UI::THUMBNAIL_SIZE_NORMAL);
>         thumbnail=th->generate_thumbnail(uri,"application/pdf");
>         if (thumbnail)          return thumbnail;
> ----<snip>---
>         So what's the problem here?
>         Thanks.
> Sincerely yours,
> Liangxu Wang


Whenever you get errors such as 'foo is not initialized', it usually
means that you have forgotten to call a library initialization
function (in this case, it's complaining that Glib::thread_init()
wasn't called).  Did you create a Gnome::Main object?  My guess is
that libgnome calls the appropriate initialization functions within
the constructor of Gnome::Main.

-- 
jonner



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