2

i'm trying to compile an Ada project.

I installed the current 2011 GNAT GPL package from Libre AdaCore, it contains the gcc compiler too.

The strange error is the following

fatal error: file dom.ali is incorrectly formatted
make sure you are using consistent versions of gcc/gnatbind

if i type which gcc it gives me /usr/gnat/bin/gcc
if i type which gnatbind it gives me /usr/gnat/bin/gnatbind

The content of "the incorrectly formatted" file is the following

V "GNAT Lib v2011"
A -gnat05
A -gnatA
P ZX
R nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnn

U dom%s         dom.ads         2bd88f63 NE OO PK IU
D dom.ads       20090519080656 2bd88f63
D system.ads        20110419093140 2d1a1afa
X 1 dom.ads
44K9*DOM 46l5 46e8

Any clue?

Thank you in advance

Edit: gnatls -v shows the following (formatted for readability),

GNATLS GPL 2011 (20110419)
Copyright (C) 1997-2011, Free Software Foundation, Inc. Source Search Path: <Current_Directory> /usr/gnat/lib/gcc/i686-pc-linux-gnu/4.5.3/adainclude/ Object Search Path: <Current_Directory> /usr/gnat/lib/gcc/i686-pc-linux-gnu/4.5.3/adalib/ Project Search Path: <Current_Directory> /usr/gnat/i686-pc-linux-gnu/lib/gnat /usr/gnat/share/gpr /usr/gnat/lib/gnat
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
michele
  • 65
  • 1
  • 3
  • 10
  • 1
    What does `gnatls -v` say? (should begin GNATLS GPL 2011...) And what OS are you using? – Simon Wright Sep 28 '11 at 06:27
  • BTW: The language is called "Ada", not "ADA". It is a name, not an abbreviation. – Rommudoh Sep 28 '11 at 06:51
  • GNATLS GPL 2011 (20110419)
    Copyright (C) 1997-2011, Free Software Foundation, Inc. Source Search Path: /usr/gnat/lib/gcc/i686-pc-linux-gnu/4.5.3/adainclude/ Object Search Path: /usr/gnat/lib/gcc/i686-pc-linux-gnu/4.5.3/adalib/ Project Search Path: /usr/gnat/i686-pc-linux-gnu/lib/gnat /usr/gnat/share/gpr /usr/gnat/lib/gnat
    – michele Sep 28 '11 at 09:59
  • I'm sorry for the bad identation, OS is ubuntu 11.04. About Ada, you're right. – michele Sep 28 '11 at 10:07
  • 2
    Since it's complaining about dom.ali, I take it you're using XMLAda. Did you download and install that as per its directions when you retrieved and installed GNAT GPL 2011? If you're using a gpr configuration file, are you 'withing' the right XMLAda gpr file? If you're using GPS project management, is your project dependency on the right XMLAda gpr file? If you're using gnatmake on the command line, are you including the right XMLAda directories? – Marc C Sep 28 '11 at 12:00
  • You are right, i had to recompile xmlada with the recent Gnat compiler, now it works, thank you! – michele Sep 28 '11 at 15:25

1 Answers1

2

All compilation units have to be compiled with exactly the same GNAT version and used library versions. If you use precompiled libraries, you might have to recompile them.

See the Debian Ada Policy part about ali files.

Rommudoh
  • 1,844
  • 10
  • 11
  • Finally that was the case, i was using an old XMLAda compiled with an old GNAT, recompiling it with latest one everything worked perfectly. – michele Sep 28 '11 at 15:25