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,FREEMAIL_FROM, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ed91c068be20374c,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.190.193 with SMTP id dj1mr2992533qab.6.1359127413680; Fri, 25 Jan 2013 07:23:33 -0800 (PST) X-Received: by 10.182.159.9 with SMTP id wy9mr192781obb.18.1359127413606; Fri, 25 Jan 2013 07:23:33 -0800 (PST) Path: k2ni2734qap.0!nntp.google.com!p13no4966777qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 25 Jan 2013 07:23:33 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=158.110.27.77; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 158.110.27.77 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5d81f181-5b5e-4b70-bcb2-0eba26d78465@googlegroups.com> Subject: Problem (and solution) with gnatcoll_db2ada From: mockturtle Injection-Date: Fri, 25 Jan 2013 15:23:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-01-25T07:23:33-08:00 List-Id: Dear all, maybe this is of some interest to few people, but I think it is worth documenting it. Recently I began working with AWS and GNATCOLL.SQL. According to the documentation about the gnatcoll_db2ada tool http://docs.adacore.com/gnatcoll-docs/sql.html#the-gnatcoll-db2ada-tool by using the option '-adacreate' gnatcoll_db2ada creates (in package Database) a procedure Create_Database that creates the database at runtime. However, when I try to compile database.adb I get the following error database.adb:136:15: non-visible declaration at gnatcoll-sql-exec.ads:208 The problem is that the procedure Database_Connection called at the end of database.adb is in GNATCOLL.SQL.Exec, not visible from database.adb. A "with + use" will, of course, cure the problem, but, as you can imagine, it gets pretty boring to add "with + use" every time you change your scheme (not often, fortunately, but it happens during the development...). Since I still have around the sources of gnatcoll_db2ada, I searched for the bug and I discovered that it suffices to add just one line in gnatcoll_db2ada-generate.adb The following is the result of diff gnatcoll_db2ada-generate.adb gnatcoll_db2ada-generate.adb~ 442,443d441 < Put_Line < (Body_File, "with GNATCOLL.SQL.Exec; use GNATCOLL.SQL.Exec;"); in case you want to apply the correction yourself. My version is quite new, I downloaded the source archive on Jan 18. I hope this can be useful. Best regards, Riccardo Bernardini