comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Ada and MySQL (mysql_library_init)
Date: Sun, 06 Dec 2009 10:59:35 -0500
Date: 2009-12-06T10:59:35-05:00	[thread overview]
Message-ID: <uvdgkm6u0.fsf@stephe-leake.org> (raw)
In-Reply-To: b13c9754-3c9f-4364-b4d0-9dfc0206c996@j35g2000vbl.googlegroups.com

Tomek Walkuski <tomek.walkuski@gmail.com> writes:

> Hi,
>
> when interacting with MySQL database I should invoke mysql_library_init
> () function first. GNADE does not have it implemented so I tried to do
> this on my own:
>
>       function mysql_library_init (
>          argc     : int;
>          argv     : chars_ptr;
>          groups   : chars_ptr
>       ) return int;
>       pragma Import (C, mysql_library_init, "mysql_library_init");
>
> used as:
>      ... := mysql_library_init (0, Null_Ptr, Null_Ptr);
>
> I build my program with -I/usr/include/mysql -L/usr/lib64/mysql -
> lmysqlcient and get:
>      undefined reference to `mysql_library_init'
>      collect2: ld returned 1 exit status
>      gnatlink: error when calling /usr/bin/gcc
>      gnatmake: *** link failed.
>
> I tested my build setting with mysql_init() and mysql_close() and it
> is fine, I cannot get mysql_library_init() and mysql_library_end
> working.
>
> Simple C application with these functions works.
>
> Any ideas?

Are you building GNADE from scratch? It contains many imports similar
to yours, so it's hard to see why yours would fail but those succeed.

On the other hand, I recently updated the Debian package for GNADE,
and discovered that the MySQL code is severly broken; the Ada types
that are supposed to duplicate C types don't; the C types have
changed.

-- 
-- Stephe



  parent reply	other threads:[~2009-12-06 15:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-05 22:41 Ada and MySQL (mysql_library_init) Tomek Walkuski
2009-12-05 23:03 ` Maciej Sobczak
2009-12-06 13:06   ` Tomek Walkuski
2009-12-06 20:49     ` Maciej Sobczak
2009-12-06 21:13       ` Tomek Walkuski
2009-12-06 15:59 ` Stephen Leake [this message]
2009-12-06 16:52   ` Tomek Walkuski
2009-12-07  6:55     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox