help / color / mirror / Atom feed
From: Jerry <>
Subject: Re: Weird error emanating from GNAT binder: duplicat "gnatS"
Date: Thu, 23 Feb 2023 16:28:47 -0800 (PST)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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
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 
    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:

   [Ada]          test_gnats_problem.adb
   [gprbind]      test_gnats_problem.bexch
   [Ada]          test_gnats_problem.ali 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
gnatbind -x test_gnats_problem.ali
gnatlink test_gnats_problem.ali

  reply	other threads:[~2023-02-24  0:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21  0:11 Weird error emanating from GNAT binder: duplicat "gnatS" Jerry
2023-02-21 22:59 ` Jerry
2023-02-22  5:53   ` Niklas Holsti
2023-02-22  8:50     ` Jerry
2023-02-22  9:37       ` Jeffrey R.Carter
2023-02-22  9:49         ` Jerry
2023-02-22 14:26         ` Simon Wright
2023-02-23  6:34           ` Jerry
2023-02-23 12:57             ` Niklas Holsti
2023-02-24 20:22               ` Jeffrey R.Carter
2023-02-22  9:39       ` Jerry
2023-02-23 13:16         ` Simon Wright
2023-02-23 19:33           ` Jerry
2023-02-24  0:28             ` Jerry [this message]
2023-02-24  0:34               ` Jerry
2023-02-24  8:07                 ` R R
2023-02-26  5:30                   ` Jerry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox