本文介绍了-fdump-ada-spec:“文件”未声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

交叉发布,对comp.lang.ada没有答案。

Cross-posting, no answer on comp.lang.ada.

我正在尝试为GSL(Gnu科学图书馆)odeiv2软件包生成Ada绑定(普通微分方程)。因此,我执行以下2个步骤:

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:


  1. 转到空目录 src并执行

  1. Go to an empty directory "src" and execute

g ++ -c -fdump-ada-spec -C /usr/include/gsl/gsl_odeiv2.h

g++ -c -fdump-ada-spec -C /usr/include/gsl/gsl_odeiv2.h

转到空目录 obj并执行

Go to an empty directory "obj" and execute

gcc -c -gnat05 ../ src / *。ads

gcc -c -gnat05 ../src/*.ads

不幸的是,gsl_odeiv2.h包含stdio.h,这会导致一系列错误,例如

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"

奇怪的是,声明了文件 ,我在stdio.h中包含的/usr/include/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.

我想我的odeiv2应用程序甚至不需要FILE。那么有没有人暗示如何摆脱这个错误?

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?

推荐答案

问题再次在其他C文件中出现,但是这次我在网上找到了解决方案。从Interfaces.C_Streams:

The problem appeared again with other C files, but this time I found the solution on the web. From Interfaces.C_Streams:

  subtype FILEs is System.Address;
  -- Corresponds to the C type FILE*

这篇关于-fdump-ada-spec:“文件”未声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 02:53