comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Linking an Ada DLL with MSVC++
Date: 10 Oct 2002 16:50:31 -0400
Date: 2002-10-10T21:01:17+00:00	[thread overview]
Message-ID: <u1y6yqaqw.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 254c16a.0210101206.34540dda@posting.google.com

mcq95@earthlink.net (Marc A. Criley) writes:

> I've meticulously followed the instructions in the GNAT User Manual
> for building a DLL, along with a Microsoft-style import library (i.e.,
> the .lib and .exp files).
> 
> <snip>
> 
>    procedure Initialize_Vmf_API;
>    pragma Export(C, Initialize_VMF_API, "Initialize_VMF_API");
> 
> The header file is wrapped with 'extern "C" {' so as to avoid name
> mangling.
> 
> But when I finally link, I get a message stating that there is an
> "unresolved external symbol _Initialize_VMF_API", i.e., the function
> name with a leading underscore.

Back when I was doing this with GNAT 3.12 and Borland C++, I added the
underscore in the external name:

pragma Export (C, Initialize_VMF_API, "_Initialize_VMF_API");

That worked.

There is also the problem of which C calling convention the C++
compiler is using; Cdecl or stdcall. That can influence which link
name it looks for.

-- 
-- Stephe



  reply	other threads:[~2002-10-10 20:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10 20:06 Linking an Ada DLL with MSVC++ Marc A. Criley
2002-10-10 20:50 ` Stephen Leake [this message]
2002-10-11 11:21 ` Marc A. Criley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox