comp.lang.ada
 help / color / mirror / Atom feed
* Ada library, interfacing ADA with C
@ 2007-12-18 13:16 david-mamour
  2007-12-18 14:06 ` Robert Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: david-mamour @ 2007-12-18 13:16 UTC (permalink / raw)


Hello everybody !!!

I have to interface ADA with C and I would like to create an ADA
library.
I read the gnat manual and it is said that i can use gnatmake and a
project library.
So I use gnatmake:
$  gnatmake -Pmy_lib.gpr


I get the following message:


powerpc-eabispe-gnatbind -n -o b~lib.adb -Llib prog1.ali prog2.ali
powerpc-eabispe-gcc -c b~lib.adb


building static library for project my_lib
powerpc-eabispegnatmake:  powerpc-elf-ar not found in path.


In fact I haven't powerpc-elf-ar on my computer, so i created a link
to it with :
ln -s powerpc-eabispe-ar powerpc-elf-ar
But the problem is the same and all my PATH are good.


My project library my_lib.gpr


/******** Library project*****/
project My_Lib is
  for Source_Dirs use ("SRC");
  for Object_Dir use "CGN";
  for Library_Name use "lib";
  for Library_Dir use "LIB";
  for Library_Kind use "static";
end My_lib;


Because it didn't work, i tried to create a library with the
following
command:
powerpc-eabispe-ar rc libmy_lib.a prog1.o prog2.o


but there is an other problem because gnatlink ask me to supply an
ALI
file which has a corresponding bind file so I can't create an
executable.
Could you say me how must I use a library file with gnatlink (which
command use) ?


I forgot to say you I use Cygwin a Unix emulator.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada library, interfacing ADA with C
  2007-12-18 13:16 Ada library, interfacing ADA with C david-mamour
@ 2007-12-18 14:06 ` Robert Jones
  2007-12-19 12:42 ` Simon Wright
  2007-12-19 19:37 ` Martin Krischik
  2 siblings, 0 replies; 4+ messages in thread
From: Robert Jones @ 2007-12-18 14:06 UTC (permalink / raw)


david-mamour@hotmail.fr wrote:

> Hello everybody !!!
> 
> I have to interface ADA with C and I would like to create an ADA
> library.
> I read the gnat manual and it is said that i can use gnatmake and a
> project library.
> So I use gnatmake:
> $  gnatmake -Pmy_lib.gpr
> 
> 
> I get the following message:
> 
> 
> powerpc-eabispe-gnatbind -n -o b~lib.adb -Llib prog1.ali prog2.ali
> powerpc-eabispe-gcc -c b~lib.adb
> 
> 
> building static library for project my_lib
> powerpc-eabispegnatmake:  powerpc-elf-ar not found in path.
> 
> 
> In fact I haven't powerpc-elf-ar on my computer, so i created a link
> to it with :
> ln -s powerpc-eabispe-ar powerpc-elf-ar
> But the problem is the same and all my PATH are good.
> 
> 
> My project library my_lib.gpr
> 
> 
> /******** Library project*****/
> project My_Lib is
>   for Source_Dirs use ("SRC");
>   for Object_Dir use "CGN";
>   for Library_Name use "lib";
>   for Library_Dir use "LIB";
>   for Library_Kind use "static";
> end My_lib;
> 
> 
> Because it didn't work, i tried to create a library with the
> following
> command:
> powerpc-eabispe-ar rc libmy_lib.a prog1.o prog2.o
> 
> 
> but there is an other problem because gnatlink ask me to supply an
> ALI
> file which has a corresponding bind file so I can't create an
> executable.
> Could you say me how must I use a library file with gnatlink (which
> command use) ?
> 
> 
> I forgot to say you I use Cygwin a Unix emulator.

It may be that you are using the wrong toolset, Cygwin runs on MS Windows
and Windows runs on x86 hardware. The tools that you are using have powerpc
in their name which to me seems to imply they are for powerpc hardware.

It's just a thought, I've been wrong before.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada library, interfacing ADA with C
  2007-12-18 13:16 Ada library, interfacing ADA with C david-mamour
  2007-12-18 14:06 ` Robert Jones
@ 2007-12-19 12:42 ` Simon Wright
  2007-12-19 19:37 ` Martin Krischik
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Wright @ 2007-12-19 12:42 UTC (permalink / raw)


david-mamour@hotmail.fr writes:

> I read the gnat manual and it is said that i can use gnatmake and a
> project library.
> So I use gnatmake:
> $  gnatmake -Pmy_lib.gpr

I think you should use powerpc-eabispe-gnatmake (? note the second -,
like the other commands, not powerpc-eabispegnatmake as you have
below) instead of plain gnatmake.

> I get the following message:
>
>
> powerpc-eabispe-gnatbind -n -o b~lib.adb -Llib prog1.ali prog2.ali
> powerpc-eabispe-gcc -c b~lib.adb
>
>
> building static library for project my_lib
> powerpc-eabispegnatmake:  powerpc-elf-ar not found in path.

Very odd since you presumably have powerpc-eabispe-as. Perhaps the
bintools build failed for some reason? Can you do a plain build
to produce an executable (hello_world.adb or some such)?

> In fact I haven't powerpc-elf-ar on my computer, so i created a link
> to it with :
> ln -s powerpc-eabispe-ar powerpc-elf-ar
> But the problem is the same and all my PATH are good.

I'm not sure that the path used by x-gnatmake is necessarily the same
as that used by ordinary calls, did you put this symlink in the same
place as the other powerpc-eabispe- tools?

> My project library my_lib.gpr
>
>
> /******** Library project*****/
> project My_Lib is
>   for Source_Dirs use ("SRC");
>   for Object_Dir use "CGN";
>   for Library_Name use "lib";
>   for Library_Dir use "LIB";
>   for Library_Kind use "static";
> end My_lib;
>
>
> Because it didn't work, i tried to create a library with the
> following
> command:
> powerpc-eabispe-ar rc libmy_lib.a prog1.o prog2.o
>
>
> but there is an other problem because gnatlink ask me to supply an
> ALI file which has a corresponding bind file so I can't create an
> executable.  Could you say me how must I use a library file with
> gnatlink (which command use) ?

The same ones that gnatmake told you it was using, as above! (use
gnatmake -v for more info if you weren't already).

> powerpc-eabispe-gnatbind -n -o b~lib.adb -Llib prog1.ali prog2.ali
> powerpc-eabispe-gcc -c b~lib.adb



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada library, interfacing ADA with C
  2007-12-18 13:16 Ada library, interfacing ADA with C david-mamour
  2007-12-18 14:06 ` Robert Jones
  2007-12-19 12:42 ` Simon Wright
@ 2007-12-19 19:37 ` Martin Krischik
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Krischik @ 2007-12-19 19:37 UTC (permalink / raw)


david-mamour@hotmail.fr wrote:

> I forgot to say you I use Cygwin a Unix emulator.

But you are developing for a real unix?

Martin

-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-19 19:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-18 13:16 Ada library, interfacing ADA with C david-mamour
2007-12-18 14:06 ` Robert Jones
2007-12-19 12:42 ` Simon Wright
2007-12-19 19:37 ` Martin Krischik

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