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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b29ea596843b99f5,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.231.138 with SMTP id tg10mr16391575pbc.7.1332683026874; Sun, 25 Mar 2012 06:43:46 -0700 (PDT) Path: kz5ni32320pbc.0!nntp.google.com!news2.google.com!postnews.google.com!b14g2000vbz.googlegroups.com!not-for-mail From: Patrick Newsgroups: comp.lang.ada Subject: help bridging C and Ada Date: Sun, 25 Mar 2012 06:37:02 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 69.159.21.71 Mime-Version: 1.0 X-Trace: posting.google.com 1332683026 20992 127.0.0.1 (25 Mar 2012 13:43:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 25 Mar 2012 13:43:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b14g2000vbz.googlegroups.com; posting-host=69.159.21.71; posting-account=cUi90woAAADTaOISowbbHM8GUD0-opJO User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.26+ (KHTML, like Gecko) Version/5.0 Safari/534.26+,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-03-25T06:37:02-07:00 List-Id: 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