More info.
* I reduced the MWE to not referencing Common package—it’s now only a main program.
* I changed file name and program name to lower case.
* I stripped down my .gpr file to nearly bare minimum.
* Observe presence or absence of “with GNAT.OS_Lib” in main and “for Casing use "mixedcase”” in .gpr.
Results summary:
* Compiling with gnatmake works always.
* Compiling with gprbuild shows dependence between presence or absence of the two lines. Details follow.
* Recall that I am on MacOS. I have had to use the “mixedcase” flag to mitigate other problems in the past.
* My current workaround is to not use GNAT.OS_Lib which is sub-optimal.
Main program (Lower-case file and procedure names), test_gnats_problem.adb
-- with GNAT.OS_Lib; -- <<<<<
procedure test_gnats_problem is
begin
null;
end test_gnats_problem;
===========================================================
Build command, gprbuild:
gprbuild -p /Users/jb/Documents/Programs/Ada/Code/My_Projects/TextMate_Sampling/build.gpr
GPR file, build.gpr:
project Build is
for Source_Dirs use
("/Users/jb/Documents/Programs/Ada/Code/My_Code/Examples_and_Snippets_and_Notes");
for Object_Dir use "build-normal";
for Exec_Dir use "product-normal";
for Main use ("test_gnats_problem.adb");
package Builder is
for Default_Switches ("Ada") use ("-gnat12");
for Executable ("test_gnats_problem.adb") use "run";
end Builder;
package Naming is
-- for Casing use "mixedcase"; -- <<<<<
end Naming;
end Build;
Results: Y Compiles, N Does not compile
for Casing use "mixedcase" -- for Casing use "mixedcase"
with GNAT.OS_Lib N Y
-- with GNAT.OS_Lib Y Y
gprbuild Output:
Compile
[Ada] test_gnats_problem.adb
Bind
[gprbind] test_gnats_problem.bexch
[Ada] test_gnats_problem.ali
b__test_gnats_problem.ads:144:30: error: external name duplicates name given at line 50
gprbind: compilation of binder generated file failed
gprbuild: unable to bind test_gnats_problem.adb
===========================================================
Build command, gnatmake, with output.
Produces the same result (compiles) with or without “with GNAT.OS_Lib”
$ gnatmake /Users/jb/Documents/Programs/Ada/Code/My_Code/Examples_and_Snippets_and_Notes/test_gnats_problem.adb
gcc -c -I/Users/jb/Documents/Programs/Ada/Code/My_Code/Examples_and_Snippets_and_Notes/ -I- /Users/jb/Documents/Programs/Ada/Code/My_Code/Examples_and_Snippets_and_Notes/test_gnats_problem.adb