How to bind to OpenCV for GNAT?
Asked Answered
D

2

2

Can anybody tell me how to find or create a binding to OpenCV for GNAT? I want to use Ada2005 to implement some program with OpenCV (1.0 or 2.X), but I don't know how. Can anybody teach me how to do it?

Dixon answered 3/8, 2011 at 14:41 Comment(0)
I
7

Teaching you how to create a binding to a complex library is beyond the scope of StackOverflow, but you might start with this tutorial. Then study the relevant GNAT library sources, e.g. Ada.Numerics, and other existing Ada bindings. Among others, Ada 2005 Math Extensions and An Ada binding to the GNU GMP and MPFR Multiple Precision libraries are exemplary as well as accessible.

Ingemar answered 3/8, 2011 at 15:2 Comment(2)
See also Interfacing Ada to C, mentioned here.Ingemar
See also Gem #59: Generating Ada bindings for C headers.Ingemar
F
3

If you have Gnat Pro (and presumably a support contract from ACT), I think you can get a binding generator from them.

In the comments, Simon Wright pointed out that you can get this binding generator from GCC 4.6.0., which is the official (although sometimes a bit behind) GCC distribution. I generally suggest folks who aren't paying ACT customers get their compiler from GCC, rather than the GNAT GPL version from ACT.

Femme answered 3/8, 2011 at 21:58 Comment(3)
Actually available with GCC 4.6.0 (goo.gl/IXRjL) also, and I'd expect GNAT GPL too.Jupon
The “binding generator” link should (today) be to adacore.com/wp-content/files/auto_update/gnat-unw-docs/html/… - the auto_update in the link seems to mean what it says, so any deep link is subject to change without notice.Jupon
@SimonWright - Quite right, as it has changed yet again since your comment. Modified to show today's link. :-(Femme

© 2022 - 2024 — McMap. All rights reserved.