* Help - Interfacing with C using Ada 83
@ 1996-10-09 0:00 Tai Pan
1996-10-11 0:00 ` Greg Dickie X2955
1996-10-13 0:00 ` Jim Dorman
0 siblings, 2 replies; 3+ messages in thread
From: Tai Pan @ 1996-10-09 0:00 UTC (permalink / raw)
Can somebody tell me how to get Ada 83 to call a C routine in an MS-DOS
environment? I'm using an ActivAda compiler and Borland C++ v4.51. The C
routine returns null terminated strings up to 255 characters. I have the
C source so the C compiler settings can be adjusted if required.
Portability is not an issue.
My project engineer says it can't be done. I find this hard to believe
but I'm new to Ada and don't have much "hands on". I'm a bit paranoid
about playing with the Ada compiler since compiling the demo "hello
world" with three (!) added resulted in a compiler crash that scrambled
my primary drive (not running the program, just trying to compile it).
Surely Ada can handle such a seemingly simple task. Any help would be
appreciated. Thanks in advance.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help - Interfacing with C using Ada 83
1996-10-09 0:00 Help - Interfacing with C using Ada 83 Tai Pan
@ 1996-10-11 0:00 ` Greg Dickie X2955
1996-10-13 0:00 ` Jim Dorman
1 sibling, 0 replies; 3+ messages in thread
From: Greg Dickie X2955 @ 1996-10-11 0:00 UTC (permalink / raw)
Have not done this in DOS but we do it all the time in Windows/UNIX and I
don't see any difference. Essentially you need a pragma interface in the
ADA code to define the C call. The other ActivADA compilers I've only used
with MSVC++ object files but I believe the Borland format is the same so
you just need to link the C object file in with the rest of the ADA code.
THis is a pretty straightforward operation.
Hope this helps
Tai Pan (lbfoster@hiwaay.net) wrote:
: Can somebody tell me how to get Ada 83 to call a C routine in an MS-DOS
: environment? I'm using an ActivAda compiler and Borland C++ v4.51. The C
: routine returns null terminated strings up to 255 characters. I have the
: C source so the C compiler settings can be adjusted if required.
: Portability is not an issue.
: My project engineer says it can't be done. I find this hard to believe
: but I'm new to Ada and don't have much "hands on". I'm a bit paranoid
: about playing with the Ada compiler since compiling the demo "hello
: world" with three (!) added resulted in a compiler crash that scrambled
: my primary drive (not running the program, just trying to compile it).
: Surely Ada can handle such a seemingly simple task. Any help would be
: appreciated. Thanks in advance.
--
-------------------------------------------------------------------------
Greg Dickie
Just a Guy
CAE Electronics Ltd.
Montreal, Canada
(514) 341-6780 X2955
greg@cae.ca
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help - Interfacing with C using Ada 83
1996-10-09 0:00 Help - Interfacing with C using Ada 83 Tai Pan
1996-10-11 0:00 ` Greg Dickie X2955
@ 1996-10-13 0:00 ` Jim Dorman
1 sibling, 0 replies; 3+ messages in thread
From: Jim Dorman @ 1996-10-13 0:00 UTC (permalink / raw)
Have you tried using Microsoft C? There is a difference between Microsoft
and Borland versions of C & C++. Earlier versions of Alsys compilers only
had an interface to Metaware Hi-C. I don't remember if that is the case
with ActivAda or not. However, you would think that ActivAda should work
with Microsoft, since with a Windows target it accesses the Windows API!??
Borland is another matter.
Another option for using Ada83 with C is with the IntegrAda product line.
You can use IntegrAda/386 or IntegrAda for Windows. Both have an interface
to both Microsoft and Borland C. Neither currently has an interface to
that version of Borland C++. However, a new version of IntegrAda/386 will
be released by the end of October 1996 that has an interface to Fortran
Powerstation and Visual C++.
IntegrAda/386 also allows you to target both 16 and 32 bit applications by
merely making a simple menu choice.
For more information on the IntegrAda systems (or other PC-based Ada
compilers) you can visit the WEB Site for "The Home of PCADA" at
"http://www.pcada.com."
Demo disks and online brochures are available for your convenience.
--
Jim Dorman
Active Engineering Technologies, Inc.
Home of PC ADA
Voice: (619) 414-9001
Fax: (619) 414-9192
email: jimd@pcada.com
URL: http://www.pcada.com
Member of Team Ada!
Tai Pan <lbfoster@hiwaay.net> wrote in article
<325C73A2.6994@hiwaay.net>...
> Can somebody tell me how to get Ada 83 to call a C routine in an MS-DOS
> environment? I'm using an ActivAda compiler and Borland C++ v4.51. The C
> routine returns null terminated strings up to 255 characters. I have the
> C source so the C compiler settings can be adjusted if required.
> Portability is not an issue.
>
> My project engineer says it can't be done. I find this hard to believe
> but I'm new to Ada and don't have much "hands on". I'm a bit paranoid
> about playing with the Ada compiler since compiling the demo "hello
> world" with three (!) added resulted in a compiler crash that scrambled
> my primary drive (not running the program, just trying to compile it).
> Surely Ada can handle such a seemingly simple task. Any help would be
> appreciated. Thanks in advance.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-10-13 0:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-09 0:00 Help - Interfacing with C using Ada 83 Tai Pan
1996-10-11 0:00 ` Greg Dickie X2955
1996-10-13 0:00 ` Jim Dorman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox