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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,65131be031e94e02 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-21 10:44:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!newsfeed.berkeley.edu!ucberkeley!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: newbie: Problem with calling functions in shared library Date: 21 Mar 2001 13:28:03 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <01c0b063$c08079b0$668e4991@pc1944> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 985200141 3538 128.183.220.71 (21 Mar 2001 18:42:21 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 21 Mar 2001 18:42:21 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 Xref: supernews.google.com comp.lang.ada:5974 Date: 2001-03-21T18:42:21+00:00 List-Id: "Fokker Space" writes: > I have a question regarding Ada and libraries with the use of GNAT. We have > the following situation under operating system IRIX: > > 1) Ada source without main routine -> compile with gnatmake or gcc -> Get a > .o file > 2) Link the .o file to a shared library .so with the use of > gnatlink > 3) An exe (from a C-source) loads the shared library with the > dlopen-function. > 4) The exe determines the places of procedures and functions in the shared > library with the dlsym-function and calls them. > > The problem is that I keep getting crashes when calling the functions in > the shared library. When I compile the same Ada source with the C-source > into a seperate exe the problem doesn't occur. I suspect I am compiling or > linking the shared library with the wrong flags or something like that. > > Does anybody know what to do it this situation Do you call adainit and adafinal? Read the GNAT manual section on Ada code with non-Ada main. > or (even better) have a small example of a working program? Only on Windows NT. > > > Bart Schipperijn -- -- Stephe