Glib assertion failed messages



Hi,

I have a very simple program that uses glib (indirectly). Actually I only define
a GError variable. I'm getting the following messages when I run it :

(process:3085): GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed, use 
IA__g_type_init() prior to this function
(process:3085): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed

Although it says CRITICAL, the program does seem to run... what is wrong here ?
and how can I fix it and remove these messages ?

I've included my c++ code below.

Thanks for any help,
Joao

//------------------------------------------------------------------------------

#include <iostream>
#include <glib.h>
#include <glib/poppler.h>

using namespace std;

class Pdf {
public:
 Pdf(const char *filename);

private:
 PopplerDocument *doc;
};
Pdf::Pdf(const char *filename) {
 GError *err = NULL;
 doc = poppler_document_new_from_file(filename, NULL, &err);
 if(err != NULL) {
   cout << "Can\'t open " << filename << "\n";
   cout << err->message << "\n";
 }
}

int
main(int argc, char **argv)
{
 char *filename = "/home/joao/unidialog/200503.pdf";

 Pdf *pdf = new Pdf(filename);
}


--
Joao Moreira de Sa Coutinho
joao moreira free fr





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