我在包裹可见性方面遇到了麻烦。我有一个非常简单的包,下面列出了代码。错误消息显示在这里:
viterbi.adb:12:14: "Integer_Text_IO" is not visible (more references follow)
viterbi.adb:12:14: non-visible declaration at a-inteio.ads:18
gnatmake: "viterbi.adb" compilation error
封装规格如下:
package Viterbi is
procedure Load_N_File(
Filename : in String;
N : in out Integer;
M : in out Integer);
end Viterbi;
包体如下:
with Ada.Integer_Text_IO; use with Ada.Integer_Text_IO;
with Ada.Strings; use Ada.Strings;
package body Viterbi is
procedure Load_N_File(
Filename : in String;
N : in out Integer;
M : in out Integer
) is
N_File : File_Type;
begin
Open( N_File, Mode=>In_File, Name=>Filename );
Get( N_File, N );
Get( N_File, M );
Close( N_File );
end Load_N_File;
end Viterbi;
我的包裹体中的什么导致包裹保持隐藏状态?use 子句不应该将 Integer_Text_IO 纳入视野吗?