I have the following code:
with Util.Serialise;
package body blah is
Reader : Util.Serialize.IO.JSON.Parser;
Mapper : Util.Serialize.Mappers.Processing;
end blah;
So the line where Reader
is defined is fine with the compiler, however on the following I get the error Mappers not declared in Serialize
.
Both packages are part of the Ada-Util installation, and in fact are in the same directory.
Is this a path issue? Have I used things wrongly? What's going on here?
You need to with Util.Serialize.Mappers;
as well, if it's a child package.
You should also need a with Util.Serialize.IO.JSON;
, don't know why you didn't get an error there
Probably Reader
is considered as correct, because it is hidden by Mapper
error.
Generally, in Ada you have to give the full package name if you want to have a package visible. Thus, your first two lines should be:
with Util.Serialize.IO.JSON;
with Util.Serialize.Mappers;
not just
with Util.Serialise;
In that situation, you enable package Utils.Serialize
, not the two which you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With