comp.lang.ada
 help / color / mirror / Atom feed
From: Larry Hazel <lhazel@mindspring.com>
Subject: Re: Calling Custom C Functions From Ada
Date: Tue, 21 Aug 2001 16:23:31 -0500
Date: 2001-08-21T21:23:45+00:00	[thread overview]
Message-ID: <3B82D153.9BFE40A5@mindspring.com> (raw)
In-Reply-To: 8e205e9b.0108211257.4c56b7d9@posting.google.com

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



  parent reply	other threads:[~2001-08-21 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-21 20:57 Calling Custom C Functions From Ada Brant
2001-08-21 21:22 ` Ted Dennison
2001-08-21 21:23 ` Larry Hazel [this message]
2001-08-22  2:01 ` Warren W. Gay VE3WWG
2001-08-22 16:45 ` Brant
  -- strict thread matches above, loose matches on Subject: below --
2001-08-21 22:17 Beard, Frank
replies disabled

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