From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a36a9db79cd4c60d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Ada and MySQL (mysql_library_init) References: From: Stephen Leake Date: Sun, 06 Dec 2009 10:59:35 -0500 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:L3ombnhKUXE28V74ZqmgwZDMF+k= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 1d50d4b1bd4f1e197caa703203 Xref: g2news1.google.com comp.lang.ada:8322 Date: 2009-12-06T10:59:35-05:00 List-Id: Tomek Walkuski 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