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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b29ea596843b99f5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.227.230 with SMTP id sd6mr11251422pbc.8.1332871761811; Tue, 27 Mar 2012 11:09:21 -0700 (PDT) Path: z9ni8352pbe.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: help bridging C and Ada Date: Tue, 27 Mar 2012 11:09:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: <14975152.314.1332871760974.JavaMail.geo-discussion-forums@yneo2> References: NNTP-Posting-Host: 24.230.150.102 Mime-Version: 1.0 X-Trace: posting.google.com 1332871761 4502 127.0.0.1 (27 Mar 2012 18:09:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 27 Mar 2012 18:09:21 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=24.230.150.102; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-03-27T11:09:20-07:00 List-Id: On Sunday, March 25, 2012 8:37:02 AM UTC-5, Patrick wrote: > Please forgive any ignorance in this post. I am not a professional > programmer. In fact this is why I am attracted to Ada. I believe the > strict compiler will substitute for years of experience with buggy > languages. This seem to be an overlooked feature of the language. >=20 > While I am planning on using it for embedded use later, at the moment > it is all desktop and as you know, it's a world dominated by C and > it's cousins. >=20 > I am having some luck with gnat's -fdump-ada-spec feature and I can > use it to integrate simple C functions I have written. >=20 > However when I try to bind large libraries like gstreamer I end up > with a sort of dependency hell. -fdump-ada-spec-slim just generates > the one spec file but when I try to build with the generated spect, I > get errors about other spec files missing. Without the slim option I > get about 100 specs. I tried to "with" them all but I ended up with > more errors about circular dependencies. >=20 > I've also tried pragma import. I can get an executable compiled but > when I call it I get errors like: stack overflow (or erroneous memory > access) >=20 > that was with with Gstreamer and I had others errors when I tried the > same process with gtk. >=20 > All I really need is a way to create a small bridge between a C > application and an Ada one. Is there a way to do this without creating > such a deep interface with fdump? Should I try the pragma route some > more or is this feature problematic? >=20 > I am not attracted to pipes but is this a more sensible option? >=20 > If anyone would like me to post code please let me know. >=20 > Thanks for reading-Patrick You could try running it (the C code) through the preprocessor first. This = will mean that you end up with a single file though, eliminating the multip= le header file problem... this would of course have the drawback of not pre= serving where structures are declared.