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,93f13c4bf2e19e49 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-21 14:23:52 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Larry Hazel Newsgroups: comp.lang.ada Subject: Re: Calling Custom C Functions From Ada Date: Tue, 21 Aug 2001 16:23:31 -0500 Organization: MindSpring Enterprises Message-ID: <3B82D153.9BFE40A5@mindspring.com> References: <8e205e9b.0108211257.4c56b7d9@posting.google.com> NNTP-Posting-Host: c7.ae.9d.12 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 21 Aug 2001 21:23:45 GMT X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en,x-ns11F8K63r3NhQ,x-ns2r2e09OnmPe2 Xref: archiver1.google.com comp.lang.ada:12193 Date: 2001-08-21T21:23:45+00:00 List-Id: Brant wrote: > > Hi Gang, > > I'm trying to call a custom C function from an Ada program. I've set > my Ada program up using the INTERFACE pragma, but I can't seem to get > the linker to locate the associated C object code. > > I've written and built my C functions using Microsoft Visual C++; I've > tried both static and dynamic libraries, so I get the *.lib, *.obj > files along with a *.exp file. I'm using a DDC-I DACS Ada compiler > under Windows NT. > > When I link my Ada code, which one of the generated C files do I need > to reference? No matter which I choose I get an "adalink: undefined > reference to `MyFunction'" error, which is the same error I get when I > don't even point to a file. Do I need to do some tweaking of the C > files? Do I need to reference the specific function (as opposed to > just a file) when I link? > > Any help would be greatly appreciated! > Thanks, > Brant IIRC, the C compiler mangles the name, so you must reference "_MyFunction" or something. I'm not sure if the name mangling is the same for different C compilers. Larry -- Larry Hazel 480 West Point Loop Somerville, AL 35670-5533