2011-07-18 47 views
2

我最近更新的GNAT編譯器的新版本..我試圖編譯GNADE源(http://gnade.sourceforge.net/)阿達編譯缺少亞基

是否有某種標誌我需要設置或某種方式來調試呢?

我看到這個錯誤(當使用GNATPro 6.22下編譯罰款):

gnatmake -g -O0 -fstack-check -pipe -gnatE -gnatU -gnatwl -gnatf -gnatE -gnat05 -p -PLibBuildGNADE.gpr 
gcc -c -fPIC -g -O0 -fstack-check -pipe -gnatE -gnatU -gnatwl -gnatf -gnatE -gnat05 -I- -gnatA /home/user1/GNADE/src/gnu-db-sqlcli-generic_attr-boolean_attribute.adb 
cannot generate code for file gnu-db-sqlcli-generic_attr-boolean_attribute.adb (missing subunits) 

這裏是規範源(gnu-db-sqlcli-generic_attr-boolean_attribute.ads)

------------------------------------------------------------------------------- 
--                   -- 
--      GNADE : GNu Ada Database Environment    -- 
--                   -- 
-- Author   : Juergen Pfeifer <[email protected]> 
-- 
-- Copyright (C) 2000-2001 Juergen Pfeifer 
--                   -- 
-- GNADE is free software; you can redistribute it and/or modify it under -- 
-- terms of the GNU General Public License as published by the Free Soft- -- 
-- ware Foundation; either version 2, or (at your option) any later ver- -- 
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- 
-- for more details. You should have received a copy of the GNU General -- 
-- Public License distributed with GNAT; see file COPYING. If not, write -- 
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- 
-- MA 02111-1307, USA.              -- 
--                   -- 
-- As a special exception, if other files instantiate generics from this -- 
-- unit, or you link this unit with other files to produce an executable, -- 
-- this unit does not by itself cause the resulting executable to be -- 
-- covered by the GNU General Public License. This exception does not -- 
-- however invalidate any other reasons why the executable file might be -- 
-- covered by the GNU Public License.          -- 
--                   -- 
-- GNADE is implemented to work with GNAT, the GNU Ada compiler.   -- 
--                   -- 
------------------------------------------------------------------------------- 
generic 
    type Bool_Type is mod <>; 
package GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute is 

    type Attribute_Value_Pair_Boolean_Scalar is new Attribute_Value_Pair 
    with 
     record 
     Value : Boolean; 
     end record; 
    function To_String (Object : Attribute_Value_Pair_Boolean_Scalar) 
         return String; 

    function GetAttr (Handle : Context; 
        Attribute : T; 
        Data  : Aux; 
        MaxLength : SQLSMALLINT := 0; 
        ErrorCode : access SQLRETURN) 
        return Attribute_Value_Pair_Boolean_Scalar; 

    procedure SetAttr (Handle : in Context; 
         AV_Pair : in Attribute_Value_Pair_Boolean_Scalar; 
         Data  : in Aux; 
         ErrorCode : out SQLRETURN); 

private 
    Default_Len : constant Base := Base (Length_Indicator (Bool_Type'Size)); 

end GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute; 

這裏是體源(GNU-DB-sqlcli-generic_attr-boolean_attribute.adb)

------------------------------------------------------------------------------- 
--                   -- 
--      GNADE : GNu Ada Database Environment    -- 
--                   -- 
-- Author   : Juergen Pfeifer <[email protected]> 
-- 
-- Copyright (C) 2000-2003 Juergen Pfeifer 
--                   -- 
-- GNADE is free software; you can redistribute it and/or modify it under -- 
-- terms of the GNU General Public License as published by the Free Soft- -- 
-- ware Foundation; either version 2, or (at your option) any later ver- -- 
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- 
-- for more details. You should have received a copy of the GNU General -- 
-- Public License distributed with GNAT; see file COPYING. If not, write -- 
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- 
-- MA 02111-1307, USA.              -- 
--                   -- 
-- As a special exception, if other files instantiate generics from this -- 
-- unit, or you link this unit with other files to produce an executable, -- 
-- this unit does not by itself cause the resulting executable to be -- 
-- covered by the GNU General Public License. This exception does not -- 
-- however invalidate any other reasons why the executable file might be -- 
-- covered by the GNU Public License.          -- 
--                   -- 
-- GNADE is implemented to work with GNAT, the GNU Ada compiler.   -- 
--                   -- 
------------------------------------------------------------------------------- 
with Ada.Unchecked_Conversion; 
with System.Address_To_Access_Conversions; 

package body GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute is 

    function To_String (Object : Attribute_Value_Pair_Boolean_Scalar) 
         return String is 
    begin 
     return Boolean'Image (Object.Value); 
    end To_String; 

    function GetAttr (Handle : Context; 
        Attribute : T; 
        Data  : Aux; 
        MaxLength : SQLSMALLINT := 0; 
        ErrorCode : access SQLRETURN) 
        return Attribute_Value_Pair_Boolean_Scalar 
    is 
     pragma Unreferenced (MaxLength); 
     package P is new System.Address_To_Access_Conversions (Bool_Type); 

     Value : aliased Bool_Type; 
     Len : Base := Default_Len; 
     Res : Boolean := False; 
    begin 
     Get (Handle, 
      Attribute, 
      To_SQLPOINTER (P.To_Address 
          (P.Object_Pointer'(Value'Access))), 
      Len, 
      Data, 
      ErrorCode); 
     if Value /= 0 then 
     Res := True; 
     end if; 
     return Attribute_Value_Pair_Boolean_Scalar' 
     (Attribute => Attribute, 
     Value  => Res); 
    end GetAttr; 

    procedure SetAttr (Handle : in Context; 
         AV_Pair : in Attribute_Value_Pair_Boolean_Scalar; 
         Data  : in Aux; 
         ErrorCode : out SQLRETURN) 
    is 
     function Cvt is new Ada.Unchecked_Conversion (SQLINTEGER, SQLPOINTER); 
     Len : constant Base  := Default_Len; 
     Val : aliased Bool_Type := 0; 
    begin 
     if AV_Pair.Value then 
     Val := 1; 
     end if; 
     Set (Handle, AV_Pair.Attribute, 
      Cvt (SQLINTEGER (Val)), 
      Len, 
      Data, 
      ErrorCode); 
    end SetAttr; 


end GNU.DB.SQLCLI.Generic_Attr.Boolean_Attribute; 

回答

1

你在自我回答中提到的-x標誌正是如此描述:

表明,來源不屬於任何項目文件的一部分,可以 編譯。通常,使用Project文件時,只有源文件是 部分的項目文件纔可以編譯。使用此開關時,可能會編譯所有「項目文件」之外的源代碼。 ALI文件和 目標文件將被放入主要的 項目的目標目錄中。所使用的編譯開關將只在命令行中指定的編譯開關爲 。即使在使用-x時, 命令行中指定的市電也需要是項目文件的來源。

因此,看起來發生了什麼是您正在使用項目文件,並且有一些您正在使用的單元,您沒有打算將它們放入任何項目文件中。我在猜測一切在GNU.DB

我想解決的辦法是繼續並將這些額外的資源放在某個項目文件中,或者繼續使用-x標誌構建。

1

一時興起,我通過在編譯器的'-x'標誌中,它似乎解決了這個問題。