[Previo por Fecha] [Siguiente por Fecha] [Previo por Hilo] [Siguiente por Hilo]

[Hilos de Discusión] [Fecha] [Tema] [Autor]

[Ayuda] Una pregunta de Gnome DB



Holas hace unos días trato de ver algo con gnomedb.

Encontré un ejemplo en esta web 
http://elrincondetux.d2g.com/tigrux/gnomedb-demo/

de la cual cambie unos datos:

#include <libgnomedb/libgnomedb.h>

GdaConnectionPool* gda_connection_pool_new;
GdaConnection* cnc;
GdaRecordset* recset;

gulong reccount=0; 
gchar *source= "Usuarios";
gchar *user= "mysql";
gchar *pass="openfree"; 

const char * fill_recordset() {
// connection_pool = gda_connection_pool_new(); 
 if (!GDA_IS_CONNECTION_POOL())
       return "No pudo iniciar mar de conexiones\n";
       cnc =
gda_connection_pool_open_connection(gda_connection_pool_new(), source,
user, pass);
       if (!GDA_IS_CONNECTION(cnc))
                 return "No pudo iniciar conexion\n";
             recset = gda_connection_execute(cnc, "select * from foro",
&reccount, 0);
           if(!GDA_IS_RECORDSET(recset))
                 return "No pudo ejecutar consulta\n";
         return NULL;
}

 int main(int argc, char *argv[]) {
         const char *error_s;
         GtkWidget *window;
         gnome_db_init(NULL, NULL, argc, argv);
//         error_s= fill_recordset();
         window= gtk_window_new(GTK_WINDOW_TOPLEVEL);
         gtk_window_set_title(GTK_WINDOW(window),"GnomeDB demo");
        
gtk_signal_connect(GTK_OBJECT(window),"delete_event",gtk_main_quit,NULL);
          if(!error_s) {
                 GtkWidget *grid;
                 grid= gnome_db_grid_new(); //grid=
gnome_db_grid_new(recset);
                 gtk_container_add(GTK_CONTAINER(window),grid);
         }
         else {
                 GtkWidget *label;
                 label= gtk_label_new(error_s);
                 gtk_container_add(GTK_CONTAINER(window),label); 
         }
         gtk_widget_show_all(window);
         gtk_main(); 
         if(recset)
                 gda_recordset_free();// gda_recordset_free(recset);
        if(cnc)
        gda_connection_free();//gda_connection_free(cnc);
        if(connection_pool) {
        gda_connection_pool_close_all();//
gda_connection_pool_close_all(connection_pool);
        gda_connection_pool_free();//gda_connection_pool_free(connection_pool);
        }
return 0;
}

Sin embargo me salen algunos problemas en la compilación...
gcc -Wall `pkg-config --cflags libgnomedb libgda --libs gtk+-2.0` -o dos
002.c
002.c:3: error: error sintáctico before '*' token
002.c:3: aviso: type defaults to `int' in declaration of
`gda_connection_pool_new'
002.c:3: aviso: data definition has no type or storage class
002.c:5: error: error sintáctico before '*' token
002.c:5: aviso: type defaults to `int' in declaration of `recset'
002.c:5: aviso: data definition has no type or storage class
002.c: En la función `fill_recordset':
002.c:14: aviso: implicit declaration of function
`GDA_IS_CONNECTION_POOL'
002.c:16: aviso: implicit declaration of function
`gda_connection_pool_open_connection'
002.c:16: aviso: asignación se crea un puntero desde un entero sin una
conversión
002.c:19: aviso: implicit declaration of function
`gda_connection_execute'
002.c:19: aviso: asignación se crea un puntero desde un entero sin una
conversión
002.c:20: aviso: implicit declaration of function `GDA_IS_RECORDSET'
002.c: En la función `main':
002.c:46: aviso: implicit declaration of function `gda_recordset_free'
002.c:48: aviso: implicit declaration of function `gda_connection_free'
002.c:49: error: `connection_pool' undeclared (first use in this
function)
002.c:49: error: (Each undeclared identifier is reported only once
002.c:49: error: for each function it appears in.)
002.c:50: aviso: implicit declaration of function
`gda_connection_pool_close_all'
002.c:51: aviso: implicit declaration of function
`gda_connection_pool_free'



.. Intente cambiar algunso datos en GdaConnection para que me encuentre
menos problemas pero aun acierto cuales por defecto sus valores son Null
sin embargo me sale errores ...


Alguna idea Saludos


-- 
+----------+-------------------------------------------+
|  .---.   |   www.unimauro.pe.kz || www.perupymes.net |
|  |º_º|   |      Carlos Mauro Cárdenas Fernández      |
|  |:_/|   |*irc.freenode.net #apesol                  |
| //   \\  |*irc.gimp.org #gnome-hispano               |   
|(|     |) |     051-001-4582877 || 051-001-97079624   |
|/'\_ _/'\ |        Jr.Las Cidras 664, Lima Peru       |
|\__) (__/ |*Lo hacemos por diversion."Linus T"        |
|__________|___________________________________________|

 
_______________________________________________
Ayuda mailing list
Ayuda en linux org mx
Para salir de la lista: http://mail.linux.org.mx/mailman/listinfo/ayuda/



[Hilos de Discusión] [Fecha] [Tema] [Autor]