Hi Jeremiah,
   it's a strange case, it doesn't work with the 1st option below (compilation1) but it works correctly (release) with the 2d one &  i have no any idea why !
   Your help is welcomed.
Thks you
Regards
Marc
Ps : Full original file in attached piece.
I guess it's a problem with gpr file

===------================

     when "compilation1" => for Default_Switches ("Ada") use
       ("-gnat2012", --Allow full Ada 2012 features (same as -gnat12)
        "-gnata",    --Assertions enabled. Pragma [Assert, Debug] activated.
        "-gnatc",    --Check syntax & semantics only (no code generation).
        "-gnatf",    --only 1st error & avertissements is displayed.
                     --ens. erreurs & avertissements sauf $8.d.Full errors.
                     --'f' causes all errors to be reported else
                     -- only 1st  error is displayed.
        "-gnaty",    --Causes the compiler to enforce specified style rules.
        "-gnatw.eD", -- ???
        "-Wall");    --Enables most warnings from the back end.


        when "release" => for Default_Switches ("Ada") use
          ("-gnat2012", --Allow full Ada 2012 features (same as -gnat12)
           "-gnatE",    --Full dynamic elaboration checks.
           "-gnatQ",    --Full dynamic elaboration checks.
           "-gnatp",    --la suppression de tous les contrôles.
           "-gnatn",    --mise du code en ligne
                            -- pour > procédures désignées pragma inline.
           "-O2"        --optimisation étendue de gcc.
             )
                & Build_Switches;


Le 27/04/2019 à 13:43, Jeremiah Breeden a écrit :
Hi Marc,

I tried it on my machine using gprbuild and it worked fine:

$ gprbuild tutorial_01.gpr
Compile
   [Ada]          gnoga-application.adb
Build Libraries
   [gprlib]       gnoga.lexch
   [archive]      libgnoga.a
   [index]        libgnoga.a
Bind
   [gprbind]      tutorial_01.bexch
   [Ada]          tutorial_01.ali
Link
   [link]         tutorial_01.adb

Can you give more details on how you tried to build it (how did you organize the files, version of GNAT and GPRBUILD, etc.)?

On Mon, Apr 8, 2019 at 5:16 PM Dubois <zzb...@wanadoo.fr <mailto:zzb...@wanadoo.fr>> wrote:

    Hi world,
      below is my 1st trial to compile Tutorial_1.adb.
      Any idea, please?
    Thanks
    Regards
    Marc
    Ps : Attached file for install.

    ---------------------------------------------

    
Dubois@PC:/media/4To/Donnees/Courrier/020-Ada/Y-Outillage/030-Gnoga/gnoga-1.4a$
    
<mailto:Dubois@PC:/media/4To/Donnees/Courrier/020-Ada/Y-Outillage/030-Gnoga/gnoga-1.4a$>
    gnatmake -P/media/4To/Donnees/Courrier/020-Ada/O-Projets/tutorial_01
    Compile
       [Ada]          tutorial_01.adb
    Bind
       [gprbind]      tutorial_01.bexch
       [Ada]          tutorial_01.ali
    gcc: error: b__tutorial_01.adb: Aucun fichier ou dossier de ce type
    gcc: warning: ‘-x ada’ after last input file has no effect
    gcc: fatal error: no input files
    compilation terminated.
    gprbind: compilation of binder generated file failed
    gprbuild: unable to bind tutorial_01.adb
    gcc-7 -c -gnat2012 -gnata -gnatc -gnatf -gnaty -gnatw.eD -Wall -I-
    -gnatA
    
/media/4To/Donnees/Courrier/020-Ada/M-Sources/100-Gnoga/tutorial_01/A-src/tutorial_01.adb
    gnatmake: "tutorial_01.ali" WARNING: ALI or object file not found
    after compile
    gnatmake:
    
"/media/4To/Donnees/Courrier/020-Ada/M-Sources/100-Gnoga/tutorial_01/A-src/tutorial_01.adb"
    compilation error

    _______________________________________________
    Gnoga-list mailing list
    Gnoga-list@lists.sourceforge.net
    <mailto:Gnoga-list@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/gnoga-list



_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list
              -- GNOGA_TUTORIAL_01   22.04.2019  15H33

with 
"/media/4To/Donnees/Courrier/020-Ada/X-Bibliotheque/035-Gnoga-1.4a/share/gpr/gnoga.gpr";

Project Tutorial_01 is
  version := "2019";
  for Languages use ("Ada");
  for Main use ("tutorial_01.adb");

   -- Types

  type OS_Type is ("GNU/Linux", "Unix", "Windows", "Windows_NT");
  type Mode_Type is
       ("compilation1", "compilation2", "compilation3", "debug", "release");
          
     -- Variables

  OS : OS_Type := external ("OS", "Windows");  --Affectation directe buggee.
--  OS := "Windows";
  OS := "GNU/Linux";
  Build_Switches := ();

   
------------------------------------------------------------------------------
   -- c1      ::= Pas de generation du code executable.
   -- c2      ::= c1 + unités compilation (gnatu)
   -- c3      ::= c2 + try & find the *worst* possible elaboration order + 
style rules.
   --              to *maximises* the chances to get a Program_Error during 
elaboration.
   -- debug   ::= code compile => ens. vérif. d'exécut. & info. debug, creation 
code exec.
   -- release ::= creation code executable optimisé.
   
------------------------------------------------------------------------------
--  Mode : Mode_Type := external ("Mode", "compilation1");
--  Mode : Mode_Type := external ("Mode", "compilation2");
--  Mode : Mode_Type := external ("Mode", "compilation3");
--  Mode : Mode_Type := external ("Mode", "debug");
  Mode : Mode_Type := external ("Mode", "release");  

    -- SOURCES, bibliotheques / ObjAli / Exec

  case OS is
    when "Windows" | "Windows_NT" =>
      for Source_Dirs use
    ("../M-Sources/030-AdaCore/GtkAda-examples/010-base_widget/A-src/**",
     
"/media/4To/Donnees/Courrier/020-Ada/Y-Outillage/030-Gnoga/gnoga-1.4a/obj/**");

       case Mode is
         when "compilation1"    => for Object_Dir use
     
"../M-Sources/020-gtkada_contributions_3_9/test_gtkada/A-Testes/test_gtk_button/B-objali/10-compil1/";

         when "compilation2"    => for Object_Dir use
     
"../M-Sources/020-gtkada_contributions_3_9/test_gtkada/A-Testes/test_gtk_button/B-objali/20-compil2/";

         when "compilation3"    => for Object_Dir use
     
"../M-Sources/020-gtkada_contributions_3_9/test_gtkada/A-Testes/test_gtk_button/B-objali/30-compil3/";

         when "debug"    => for Object_Dir use
     
"../M-Sources/020-gtkada_contributions_3_9/test_gtkada/A-Testes/test_gtk_button/B-objali/40-debug/";

         when "release"  => for Object_Dir use
     
"../M-Sources/020-gtkada_contributions_3_9/test_gtkada/A-Testes/test_gtk_button/B-objali/50-release/";
       end case;
    for Exec_Dir use
        
"../M-Sources/020-gtkada_contributions_3_9/test_gtkada/A-Testes/test_gtk_button/C-exec/";
 

    when "GNU/Linux" | "Unix" =>
     for Source_Dirs use
          ("../M-Sources/100-Gnoga/tutorial/tutorial_01/A-src/");

       case Mode is  
         when "compilation1"    => for Object_Dir use
      "../M-Sources/100-Gnoga/tutorial/tutorial_01/B-objali/10-compil1/";

         when "compilation2"    => for Object_Dir use
      "../M-Sources/100-Gnoga/tutorial/tutorial_01/B-objali/20-compil2/";

         when "compilation3"    => for Object_Dir use
      "../M-Sources/100-Gnoga/tutorial/tutorial_01/B-objali/30-compil3/";

         when "debug"    => for Object_Dir use
      "../M-Sources/100-Gnoga/tutorial/tutorial_01/B-objali/40-debug/";

         when "release"  => for Object_Dir use
      "../M-Sources/100-Gnoga/tutorial/tutorial_01/B-objali/50-release/";
       end case;
     for Exec_Dir use
         "../M-Sources/100-Gnoga/tutorial/tutorial_01/C-exec/";

    when others =>  null;
   end case;

             -- Parametres du BUILDER
  --Binder switches. Here switches is a list of switches that are valid switches
  --for gnatbind. They will be passed on to all bind steps performed by 
gnatmake.                 
    case Mode is
        when "compilation1"            => Build_Switches := ();  
        when "compilation2" | "debug"  => Build_Switches := ("-O0");
        when "compilation3"            => Build_Switches := 
                            ("-p", "-E",--Idem C2 + causes the binder to try and
                                        --find the *worst* possible elaboration
                                        --order, i.e. the one that *maximises*
                                        --the chances to get a
                                        --Program_Error during elaboration.
                             "-g", "-O0");
        when "release"
                       => Build_Switches := ("-O2"); 
      end case;

   -- Options de COMPILATIONS

  package Compiler is
      case Mode is
       when "compilation1" => for Default_Switches ("Ada") use
       ("-gnat2012", --Allow full Ada 2012 features (same as -gnat12)
       -- "-gnatm5",   --The m stands for maximum. n is a decimal integer.
        "-gnata",    --Assertions enabled. Pragma [Assert, Debug] activated.
        "-gnatc",    --Check syntax & semantics only (no code generation).
        "-gnatf",    --only 1st error & avertissements is displayed.
                     --ens. erreurs & avertissements sauf $8.d.Full errors.
                     --'f' causes all errors to be reported else
                     -- only 1st  error is displayed.
        "-gnaty",    --Causes the compiler to enforce specified style rules.
        "-gnatw.eD", -- ???
        "-Wall");    --Enables most warnings from the back end.

       when "compilation2" => for Default_Switches ("Ada") use
       ("-gnat2012", --Allow full Ada 2012 features (same as -gnat12)
        "-gnatc",    --Check syntax & semantics only (no code generation).
        "-gnatf",    --only 1st error & avertissements is displayed.
                     --ens. erreurs & avertissements sauf $8.d.Full errors.
                     --'f' causes all errors to be reported else
                     -- only 1st  error is displayed.
        "-gnaty",    --Causes the compiler to enforce specified style rules.
        "-gnatu",    --Ensemble des unites requises pour la compilation.
        "-gnatw.eD", -- ???
        "-Wall")       --Enables most warnings from the back end.
                & Build_Switches;

       when "compilation3" => for Default_Switches ("Ada") use
       ("-gnat2012", --Allow full Ada 2012 features (same as -gnat12)
        "-gnatc",    --Check syntax & semantics only (no code generation).
        "-gnatfy",   --ens. erreurs & avertissements sauf $8.d.Full errors.
                     --'f' causes all errors to be reported else
                     -- only 1st  error is displayed.
                     --'y' Enable built-in style checks
        "-gnato",    --full range checks, so we could get a Constraint_Error.   
        "-gnatu",    --Ensemble des unites requises pour la compilation.
        "-gnatw.eD", -- ???
        "-Wall")       --Enables most warnings from the back end.
                & Build_Switches;

       when "debug" => for Default_Switches ("Ada") use
            ("-g",        -- information pour le devermineur
            "-gnat2012",
            "-gnatol",   --controle depassements numeriques (gal & -> 
assertions)
            "-gnateA",   -- Pas de lien entre 2 paramet. du meme sous-programme.
            "-gnatE",    --Enables dynamic checks for access-before-elaboration
                         -- on subprogram calls & generic instantiations.
            "-gnateF",   -- Depassements numeriques pour reels non contraints,
            "-gnateV",   --Control level of validity checking
                         --  (see Section 3.2.4 [Validity Checking], page 71).
            "-gnatVa",   --enable additional validity checks, not required by 
RM.
            "-E"        --like -e option, but execut. time spent in the 
function.
         -- "-fverbose-asm -S", --instructions assembleurs générées.
         -- "-gnatR2s",  --Informations détaillées sur la structure des données.
         -- "-gnatS",    --Informations détaillées sur l'unité Standard.
            )
                & Build_Switches;

        when "release" =>
         for Default_Switches ("Ada") use
             ("-gnat2012", --Allow full Ada 2012 features (same as -gnat12)
              "-gnatE",    --Full dynamic elaboration checks.
              "-gnatQ",    --Full dynamic elaboration checks.
              "-gnatp",    --la suppression de tous les contrôles.
              "-gnatn",    --mise du code en ligne
                           -- pour > procédures désignées pragma inline.
              "-O2"        --optimisation étendue de gcc. 
           -- "-O3         --produit en + mise en ligne automatique du
                           -- code des "petites" procédures
           -- (à discrét. > compilateur). Ce qui n'est pas forcément intéressant
           -- sur des programmes avec beaucoup de code.
             ) 
                & Build_Switches;
        
      end case;
   end Compiler;
   
   package Builder is
      for Executable ("main_name.adb") use "tutorial_01";
   end Builder;

end Tutorial_01;
                       -- Liste parametres du COMPILER.

         --   "-g",        -- information pour le devermineur. 
         --   "-s",
         --   "-g",
         --   "-gnat83",    --Enforce Ada 83 restrictions.
         --   "-gnat95",    --Enforce Ada 95 restrictions.
         --   "-gnat2005",  --Allow full Ada 2005 features (same as -gnat05).
         --   "-gnat2012",  --Allow full Ada 2012 features (same as -gnat12)
         --   "-gnata",     --Assertions enabled.
                            --Pragma [Assert, Debug] activated.
         --   "-gnatg",     --All warnings & style messages treated as errors.
         --   "-gnatn",     --la mise du code en ligne pour les procédures
                            --désignées par le pragma inline 
         --   "-gnato",     --full range checks, so we could get a
                            -- Constraint_Error.
 
         --   "-gnatm=n"’   --The m stands for maximum. n is a decimal integer
                            -- in the range of 1 to 999999 and
                            -- limits the number of error or warning messages 
to be generated.
                            -- For example, using ‘-gnatm2’ might yield
                            --      e.adb:3:04: Incorrect spelling of keyword 
"function"
                            --      e.adb:5:35: missing ".."
                            --      fatal error: maximum number of errors 
detected
                            --        compilation abandoned
                            --   The default setting if no switch is given is 
9999.
                            -- -gnatm=n is equivalent to -gnatmn.
         --   "-gnatf"’     --The f stands for full. Normally, the compiler 
suppresses error
                            --messages that are likely to be redundant. This 
switch causes
                            --all error messages to be generated.
                            --In particular, in the case of references to 
undefined variables.
                            --If a given variable is referenced several times, 
the normal
                            -- format of messages is e.adb:7:07: "V" is 
undefined (more references follow)
                            -- where the parenthetical comment warns that there 
are additional
                            -- references to the variable V. Compiling the same 
program with
                            -- the ‘-gnatf’ switch yields  e.adb:7:07: "V"is 
undefined
                            --                             e.adb:8:07: "V"is 
undefined
                            --                             e.adb:8:12: "V"is 
undefined
                            --                             e.adb:8:16: "V"is 
undefined
                            --                             e.adb:9:07: "V"is 
undefined
                            --                             e.adb:9:12: "V"is 
undefined
         --   "-gnaty",     --The ‘-gnatyx’ switch causes the compiler to 
enforce specified style rules.
                            --The string x is a sequence of letters or digits 
indicating the particular
                            -- style checks to be performed.
                            --  ‘y’ Set all standard style check options This 
is equivalent to
                            --  gnaty3aAbcefhiklmnprst, that is all checking 
options enabled with the
                            --  exception of ‘-gnatyB’, ‘-gnatyd’, ‘-gnatyI’, 
‘-gnatyLnnn’, ‘-gnatyo’,
                            -- ‘-gnatyO’, ‘-gnatyS’, ‘-gnatyu’, and ‘-gnatyx’.
                            --The switch ‘-gnaty’ on its own (that is not 
followed by any letters or digits)
                            -- is equivalent to the use of ‘-gnatyy’ as 
described above, that is all built-in
                            -- standard style check options are enabled.
                            --The switch ‘-gnatyN’ clears any previously set 
style checks.
         --   "-gnatwu",    --Activate warnings on unused entities.
         --   "-gnatwU",    --Suppress warnings on unused entities.   
         --   "-O0",        --No optimization (default).
         --   "-O1",        --Moderate optimization.
         --   "-O2",        --Full optimization.
         --   "-O3",        --Full optimization as in .
         --   "-Os",        --Optimize space usage (code and data).
         --   "-gnatwa"
         --   "-gnatwe",    --Treat warnings & style checks as errors. Warning
                            --string appears, but warning messages are counted
                            --as errors & prevent generation of an object file.
         --   "-gnatyg",
         --   "-gnaty-d"
         --   "-gnatfy", 
         --   "-gnatp",     --la suppression de tous les contrôles
         --   "-gnatVa",    --full optional run-time checks, which
                            -- can raise various exceptions.
         --   "-gnatwae",
         --   "-gnatpn",
         --   "-gnatg",     --All warnings & style messages treated as errors.
         --   "-gnatE",      --Full dynamic elaboration checks.
         --   "-gnatQ"       --Full dynamic elaboration checks.
         --   "-fstack-check",-- Controle de la pile.





_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to