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,9869a3929132e322 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail From: Dave Thompson Newsgroups: comp.lang.ada Subject: Re: pragma import ambiguity Message-ID: <6l8sg2d6hs5cfnfp2ag889n8qrhea3afkf@4ax.com> References: <1157560770.358187.249610@i3g2000cwc.googlegroups.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 21 Sep 2006 01:26:52 GMT NNTP-Posting-Host: 12.75.199.16 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1158802012 12.75.199.16 (Thu, 21 Sep 2006 01:26:52 GMT) NNTP-Posting-Date: Thu, 21 Sep 2006 01:26:52 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:6685 Date: 2006-09-21T01:26:52+00:00 List-Id: On 6 Sep 2006 09:39:30 -0700, "bubble" wrote: (topposted, not worth the trouble of correcting) > are you mean there are the same name symbols in a library? > > I assume your library is standard winapi and writing in C not C++. > the C++ have name decoration problem > to avoid the name decoration problem > This wasn't the OP's problem (which was within the Ada) and he(WLOG) didn't say anything to indicate he is using C++. But even if so: > you "may" use external "C" to solve it. > > like > > #ifdef __cplusplus > external "{" extern "C" { > #end if #endif > __declspec(dllexport) int clear; > int __declspec(dllexport) __stdcall clear(); > Non-standard Windows-only; but the OP _did_ imply Windows. > > #ifdef __cplusplus > } > end if > #endif > I think your C/C++ compiler should allow to compiler it because C does > not allow the same name in code. > Neither does C++ when using extern "C", formally called C linkage. And even in "real C++", you can't have both a function/routine and variable with the same name in the same namespace; overloading only works among function/routines, not for variables or typenames. - David.Thompson1 at worldnet.att.net