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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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 15:19:56 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Beard, Frank" Newsgroups: comp.lang.ada Subject: RE: Calling Custom C Functions From Ada Date: Tue, 21 Aug 2001 18:17:16 -0400 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: avanie.enst.fr 998432395 5614 137.194.161.2 (21 Aug 2001 22:19:55 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 21 Aug 2001 22:19:55 +0000 (UTC) To: "'comp.lang.ada@ada.eu.org'" Return-Path: X-Mailer: Internet Mail Service (5.5.2448.0) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.4 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:12199 Date: 2001-08-21T18:17:16-04:00 If you have access to the DUMPBIN.exe then you can run it against the DLL, LIB, etc. It's part of the VC++ installation, but Aonix supplied it in the \bin directory. Maybe DDC-I does as well. For DLLs the command is (run from DOS console): dumpbin /EXPORTS my.dll It shows you the names by which the routines have been exported. I don't remember which option works on LIB and OBJ files. "DUMPBIN /ALL my.lib" will show you everything, but it will be quite a bit of info. "DUMPBIN /?" will show you the list of options. Hope this helps. Frank -----Original Message----- From: Larry Hazel [mailto:lhazel@mindspring.com] Sent: Tuesday, August 21, 2001 5:24 PM To: comp.lang.ada@ada.eu.org Subject: Re: Calling Custom C Functions From Ada 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 _______________________________________________ comp.lang.ada mailing list comp.lang.ada@ada.eu.org http://ada.eu.org/mailman/listinfo/comp.lang.ada