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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,dc84a80bfca8c2a,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!e56g2000cwe.googlegroups.com!not-for-mail From: ltpage2@gmail.com Newsgroups: comp.lang.ada Subject: use multiple Ada libraries from C Date: 4 Apr 2006 11:07:08 -0700 Organization: http://groups.google.com Message-ID: <1144174028.858147.240200@e56g2000cwe.googlegroups.com> NNTP-Posting-Host: 192.45.72.27 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1144174034 5852 127.0.0.1 (4 Apr 2006 18:07:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 4 Apr 2006 18:07:14 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e56g2000cwe.googlegroups.com; posting-host=192.45.72.27; posting-account=-Gsv_wwAAADrLDHn81aGzUX9zBTFxZdG Xref: g2news1.google.com comp.lang.ada:3719 Date: 2006-04-04T11:07:08-07:00 List-Id: The GNAT User's Guide indicates (in section 18.4, "Creating an Ada Library to be Used in a Non-Ada Context") that more than one Ada library can be used from C at one time. I'm using GCC 3.2.3 on Linux and cannot make this work. I have two Ada libraries compiled into shared objects. I've created the necessary interface code as directed in the User's Guide so I can call the initialization and finalization routines created by gnatbind. I can use either library okay by itself, but I can't use them both from the same process. What happens is this: when I call the second library's xxxxinit() function, I get a raised PROGRAM_ERROR : init.c:172 I looked at the GCC source and found that this error is raised when __gnat_set_globals is called more than once with arguments that are different. This function is called by the elaboration routines created by gnatbind. However, all the arguments used by the two different libraries are the same, so I don't know how such a thing could be occurring. Anyone have any ideas on this? Thanks. Matt