Cross-posting, no answer on comp.lang.ada.
I am trying to generate Ada bindings for the GSL (Gnu Scientific Library) odeiv2 package (ordinary differential equations). So I do the following 2 steps:
Go to an empty directory "src" and execute
g++ -c -fdump-ada-spec -C /usr/include/gsl/gsl_odeiv2.h
Go to an empty directory "obj" and execute
gcc -c -gnat05 ../src/*.ads
Unfortunately, gsl_odeiv2.h includes stdio.h, and this leads to a series of errors like
stdio_h.ads:117:69: "FILE" not declared in "x86_64_linux_gnu_bits_types_FILE_h"
Strangely, FILE is declared, I found it in /usr/include/x86_64-linux-gnu/bits/types/FILE.h, which is included in stdio.h.
I guess that I don't even need FILE for my odeiv2 application. So has anyone a hint how to get rid of this error?
-fdump-ada-spechas to deal with the C include file mess somehow, and it does that by generating bindings for the transitive closure of the header files you request and anything they include. There is also-fdump-ada-spec-slim(or-fdump-ada-slim-spec, I forget) which only binds the specific headers you ask for. I tend to use this, and explicitly add any further headers I need to fix missing bindings. - user_1818839