-fdump-ada-spec: "FILE" 未声明
-fdump-ada-spec: "FILE" not declared
交叉发布,comp.lang.ada 上没有答案。
我正在尝试为 GSL(Gnu 科学图书馆)odeiv2 包(常微分方程)生成 Ada 绑定。所以我执行以下两个步骤:
转到空目录"src"并执行
g++ -c -fdump-ada-spec -C /usr/include/gsl/gsl_odeiv2.h
转到空目录"obj"并执行
gcc -c -gnat05 ../src/*.ads
不幸的是,gsl_odeiv2.h 包含 stdio.h,这会导致一系列错误,例如
stdio_h.ads:117:69: "FILE" not declared in "x86_64_linux_gnu_bits_types_FILE_h"
奇怪的是,FILE 是声明的,我在/usr/include/x86_64-linux-gnu/bits/types/FILE.h中找到了它,它包含在stdio.h.
中
我想我的 odeiv2 应用程序甚至不需要 FILE。那么有没有人提示如何摆脱这个错误?
The top-secret GNAT documentation says,
GNAT includes a binding generator for C and C++ headers which is intended to do 95% of the tedious work of generating Ada specs from C or C++ header files.
Note that this capability is not intended to generate 100% correct Ada specs, and will is some cases require manual adjustments, although it can often be used out of the box in practice.
因此,如果生成的绑定无法正常工作,您应该期望必须对生成的绑定进行手动调整。
其他C文件又出现了这个问题,不过这次我在网上找到了解决办法。来自 Interfaces.C_Streams:
subtype FILEs is System.Address;
-- Corresponds to the C type FILE*
交叉发布,comp.lang.ada 上没有答案。
我正在尝试为 GSL(Gnu 科学图书馆)odeiv2 包(常微分方程)生成 Ada 绑定。所以我执行以下两个步骤:
转到空目录"src"并执行
g++ -c -fdump-ada-spec -C /usr/include/gsl/gsl_odeiv2.h
转到空目录"obj"并执行
gcc -c -gnat05 ../src/*.ads
不幸的是,gsl_odeiv2.h 包含 stdio.h,这会导致一系列错误,例如
stdio_h.ads:117:69: "FILE" not declared in "x86_64_linux_gnu_bits_types_FILE_h"
奇怪的是,FILE 是声明的,我在/usr/include/x86_64-linux-gnu/bits/types/FILE.h中找到了它,它包含在stdio.h.
中我想我的 odeiv2 应用程序甚至不需要 FILE。那么有没有人提示如何摆脱这个错误?
The top-secret GNAT documentation says,
GNAT includes a binding generator for C and C++ headers which is intended to do 95% of the tedious work of generating Ada specs from C or C++ header files.
Note that this capability is not intended to generate 100% correct Ada specs, and will is some cases require manual adjustments, although it can often be used out of the box in practice.
因此,如果生成的绑定无法正常工作,您应该期望必须对生成的绑定进行手动调整。
其他C文件又出现了这个问题,不过这次我在网上找到了解决办法。来自 Interfaces.C_Streams:
subtype FILEs is System.Address;
-- Corresponds to the C type FILE*