I have a program that is written in Ada, and I need to compile it. When I do so, I get a “does not contain expected unit” error, and it says it is expecting a spec but found a body. I need it compile it, and I don’t know about Ada. I am using the gnat compiler. and i cant put any code up but i can say that it is a adb file with other ads files in the folder.
Share
The error :
usually occurs when the name of the unit does not match the file name (
package body aaa.bbbneeds to be in fileaaa-bbb.adbandpackage aaa.bbbneeds to be inaaa-bbb.ads)probably means you have a mismatch between the contents of the file and the file extension (ads or adb)
Beyond this i can only upvote the comment by Marc C