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-Thread: 103376,ae16e476a8e84b7b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!j35g2000yqh.googlegroups.com!not-for-mail From: JJ Newsgroups: comp.lang.ada Subject: Re: GNAT 2008 GPL pragma import VC++ Date: Tue, 27 Jan 2009 14:39:19 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <7d667b48-d51c-41ef-9cb4-cb3b640f8824@d32g2000yqe.googlegroups.com> NNTP-Posting-Host: 132.228.195.207 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1233095959 30266 127.0.0.1 (27 Jan 2009 22:39:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 27 Jan 2009 22:39:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j35g2000yqh.googlegroups.com; posting-host=132.228.195.207; posting-account=JEq4hQkAAAABr8u8eloUFmAKVDSiNa9p User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3511 Date: 2009-01-27T14:39:19-08:00 List-Id: On Jan 27, 3:28=A0pm, sjw wrote: > 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 a= n > > "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). One other thought... I am using GPS (Gnat Programming Studio) as my IDE. Right now I am using the -Idir_to_the_obj_file switch. This points to the VC++ object file created. Is there something else that I need in the build process?