Re: [gnome-db] [Newbie, libgda] Problem with libgda -



Hi there,

I posted a small app a couple of weeks to this list (see attachement). See if this works on your machine.  (ignore the name "crash" as it is not crashing (anymore) :) )

To compile this small app, type:

gcc libgda_crash.c -o libgda_crash `pkg-config --cflags --libs libgda-2.0`

(asuming you are using the latest cvs sources, otherwise you may need to revert back to:   gcc libgda_crash.c -o libgda_crash `pkg-config --cflags --libs libgda`

Make sure that your PKG_CONFIG_PATH is set to the lib/pkgconfig directory where libgda is installed. Also set LD_LIBRARY_PATH to the lib directory where the libgda libs are located, so you can run this.

At least this will proof if you can successfully compile with and call the libgda library.

Hope this helps,
Bas.



On Fri, 2005-07-01 at 07:29 +0200, Uzytkownik wrote:
Dnia 30-06-2005, czw o godzinie 18:52 +0200, Uzytkownik napisał(a):
> I'd like to check if libgda could create SQLite db.
> (...)
> Many fragments is from examples/manual.

Could somebody try to compile it and run?
Maybe it's problem with my libraries(I use gentoo with default gcc 4.1 -
it could be some problems with sqlite compiled with this)...

Regards.
_______________________________________________
gnome-db-list mailing list
gnome-db-list gnome org
http://mail.gnome.org/mailman/listinfo/gnome-db-list
#include <libgda/libgda.h>
#include <stdio.h>


void
list_providers (void)
{
  GList *prov_list;
  GList *node;
  GdaProviderInfo *info;

  prov_list = gda_config_get_provider_list ();

  for (node = g_list_first (prov_list); node != NULL;
       node = g_list_next (node))
    {
      info = (GdaProviderInfo *) node->data;

      g_print ("ID: %s\n", info->id);

    }

  gda_config_free_provider_list (prov_list);

}

void
list_datasources (void)
{
  GList *ds_list;
  GList *node;
  GdaDataSourceInfo *info;

  ds_list = gda_config_get_data_source_list ();

  g_print ("\n");
  for (node = g_list_first (ds_list); node != NULL; node = g_list_next (node))
    {
      info = (GdaDataSourceInfo *) node->data;

      g_print
	("NAME: %s PROVIDER: %s CNC: %s DESC: %s USER: %s PASSWORD: %s\n",
	 info->name, info->provider, info->cnc_string, info->description,
	 info->username, info->password);

    }
  g_print ("\n");

  gda_config_free_data_source_list (ds_list);

}

void
do_stuff ()
{
  GdaClient *client;
  GdaConnection *connection;

  printf("start step 1\n");
  list_providers ();
  printf("end step 1\n");

  printf("start step 2\n");
  list_datasources ();
  printf("end step 2\n");

  gda_main_quit ();
}


int
main (int argc, char **argv)
{

  g_print ("STARTING\n");
  gda_init ("TestGDA", "0.1", argc, argv);

  /* do_stuff(); */
  gda_main_run ((GdaInitFunc) do_stuff, (gpointer) NULL);

  g_print ("ENDING\n");

}


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