comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr Richard A. O'Keefe" <ok@atlas.otago.ac.nz>
Subject: Re: Compiling, binding, and linking an Ada prog. interfaced with C
Date: 1998/07/28
Date: 1998-07-28T00:00:00+00:00	[thread overview]
Message-ID: <35BD28BF.A5B@atlas.otago.ac.nz> (raw)
In-Reply-To: 1998072706002200.CAA02664@ladder01.news.aol.com

You4818 wrote:
> I am trying to interface an Ada program to C, such that the main
> program is in Ada and some entities are being imported from a
> C header file (e.g. constant variables).
> 
> For example, consider the following
> 
> C_File.h  :  #define  Max_Val 100

I see no constant variable here.  All I see is a macro.
If you tried to link this with other *C* code, say

 D_File.c:    extern int Max_Val;

it wouldn't link.  If you want a read-only object in C that
can be accessed from another C file (let alone an Ada file),
you should put

    int const MaxVal = 100;

in a .c file.




  reply	other threads:[~1998-07-28  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-27  0:00 Re:Compiling, binding, and linking an Ada prog. interfaced with C You4818
1998-07-28  0:00 ` Dr Richard A. O'Keefe [this message]
1998-07-29  0:00   ` Compiling, " Fergus Henderson
1998-07-30  0:00     ` Robert I. Eachus
1998-08-01  0:00       ` Robert Dewar
1998-08-02  0:00         ` Fergus Henderson
1998-08-04  0:00           ` Robert Dewar
1998-08-04  0:00             ` Fergus Henderson
1998-08-03  0:00         ` David Coote
1998-08-03  0:00           ` tedennison
1998-08-02  0:00       ` Fergus Henderson
     [not found] ` <6pi57h$k1h$1@nnrp1.dejanews.com>
1998-07-28  0:00   ` Ronald Ali
replies disabled

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