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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ae16e476a8e84b7b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!b38g2000prf.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: GNAT 2008 GPL pragma import VC++ Date: Tue, 27 Jan 2009 12:28:51 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <7d667b48-d51c-41ef-9cb4-cb3b640f8824@d32g2000yqe.googlegroups.com> NNTP-Posting-Host: 62.49.19.209 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1233088131 11857 127.0.0.1 (27 Jan 2009 20:28:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 27 Jan 2009 20:28:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b38g2000prf.googlegroups.com; posting-host=62.49.19.209; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:4479 Date: 2009-01-27T12:28:51-08:00 List-Id: On Jan 27, 7:30=A0pm, JJ wrote: > I have an Ada program that has a pragma import to a Visual C++ > procedure. =A0I have tried several combination's of External_Name (all > uppercase, all lowercase, mixed...) to no avail. =A0I continue to get an > "undefined reference" error during the link. > > Anyone have any experience with this? No experience with VC++; but you might be having problems with name mangling? (ie, the c++ compiler decorates the object name of the function with inscrutable encoding of the parameter/result profile, thus supporting overloading and possibly other features). You might try extern "C" { int foo(int *bar); } which (in GCC at any rate) will generate the symbol foo (or _foo, but at any rate something easier to manage).