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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,95d036084078aa89 X-Google-Attributes: gid103376,public From: "Dr Richard A. O'Keefe" Subject: Re: Compiling, binding, and linking an Ada prog. interfaced with C Date: 1998/07/28 Message-ID: <35BD28BF.A5B@atlas.otago.ac.nz>#1/1 X-Deja-AN: 375506221 Content-Transfer-Encoding: 7bit References: <1998072706002200.CAA02664@ladder01.news.aol.com> Content-Type: text/plain; charset=us-ascii Organization: Department of Computer Science, University of Otago Mime-Version: 1.0 Reply-To: ok@atlas.otago.ac.nz Newsgroups: comp.lang.ada Date: 1998-07-28T00:00:00+00:00 List-Id: 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.