Bonjour a  tous,,

Je vient de débuté avec la programmation Gtk+/Gnome.
Pour écrire un plugin avec GModule, malheureusement ça
marche voila le code: 

/*
 * Plugin
 */
#include <glib.h>
#include <gmodule.h>

G_MODULE_EXPORT gboolean 
print_the_message(gpointer data)
{
        g_printf("%s\n",(gchar *)data);
        return TRUE;
}
f2:
#include <gmodule.h>
#include <glib.h>


typedef gboolean (* PrintMessageFunc) (gpointer data);

int
main(int argc, char **argv )
{
        GModule *module ;
        PrintMessageFunc print_the_message ;
        
        g_assert(g_module_supported());
        
        module =
g_module_open("/usr/lib/plugin.so",G_MODULE_BIND_LAZY);

        if (! module)
        {
                g_error("Error: %s\n",(gchar *) g_module_error()) ;
                return -1 ;
        }
        
        if (! g_module_symbol(module,"print the
message",(gpointer*) &print_the_message))
        {
                g_error("Error: %s\n",(gchar *)g_module_error());
                return -1 ;
        }
        
        print_the_message("Hello Loading..."); 
        
        if (! g_module_close(module))
        {
                g_error("Error: %s\n",g_module_error()) ;
                return -1 ;
        }                       
        return 0;       
}


/*
 * 
 */

La sortie dans la console:
** ERROR **: Error: `print the message':
/usr/lib/plugin.so: undefined symbol: print the
message

aborting...
Abandon
        


NetBSD is very JIHBED, MONO RUN in NetBSD

http://jihbedunix.blogspot.com

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

_______________________________________________
gnome-fr-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-fr-list

Répondre à