comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: help bridging C and Ada
Date: Tue, 27 Mar 2012 11:09:20 -0700 (PDT)
Date: 2012-03-27T11:09:20-07:00	[thread overview]
Message-ID: <14975152.314.1332871760974.JavaMail.geo-discussion-forums@yneo2> (raw)
In-Reply-To: <c4221180-bf2d-48d1-a161-c56435805200@b14g2000vbz.googlegroups.com>

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.
> 
> 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.
> 
> 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.
> 
> 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.
> 
> 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)
> 
> that was with with Gstreamer and I had others errors when I tried the
> same process with gtk.
> 
> 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?
> 
> I am not attracted to pipes but is this a more sensible option?
> 
> If anyone would like me to post code please let me know.
> 
> 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 multiple header file problem... this would of course have the drawback of not preserving where structures are declared.



  parent reply	other threads:[~2012-03-27 18:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-25 13:37 help bridging C and Ada Patrick
2012-03-25 14:52 ` Patrick
2012-03-25 17:00   ` Simon Wright
2012-03-25 17:47     ` Patrick
2012-03-26 13:45   ` Stephen Leake
2012-03-26 10:03 ` Brian Drummond
2012-03-26 12:05   ` J-P. Rosen
2012-03-26 22:03     ` Brian Drummond
2012-03-27  2:44       ` Patrick
2012-03-26 12:49   ` Marc C
2012-03-27 18:09 ` Shark8 [this message]
2012-03-28  0:19   ` Patrick
replies disabled

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