comp.lang.ada
 help / color / mirror / Atom feed
* Having a problem building with win32ada
@ 2010-03-05 11:41 John McCabe
  2010-03-05 13:12 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: John McCabe @ 2010-03-05 11:41 UTC (permalink / raw)


Hi Guys

Further to my message the other day, I've downloaded the GPL 2009
version of GNAT with the Win32Ada bindings and I'm trying to do
something really simple at the moment, namely, get the number of input
and output midi devices on my system through Win32.Mmsystem.

The code I'm using is at the bottom of this message.

I've created a project in GPS (and other things) but so far have been
unsuccessful in building it and I can't see any obvious reason why.

I've set the project in GPR to reference the [known] win32ada library
and, as far as I can see, there's nothing much different to the
example "connect" application that comes with win32ada however when I
try to build it, I get this (compilation is fine, just linking doesn't
work):

gnatmake -d -PC:\\AdaProjects\\TestMidiDevs\\testmididevs.gpr
MidiDevs.adb
gnatbind -I- -x C:\AdaProjects\TestMidiDevs\mididevs.ali
gnatlink C:\AdaProjects\TestMidiDevs\mididevs.ali
-LC:\GNAT\2009\lib\win32ada\ -lwin32ada -o
C:\AdaProjects\TestMidiDevs\mididevs.exe
c:\adaprojects\testmididevs\MidiDevs.o:MidiDevs.adb:(.text+0x2d):
undefined reference to `_midiInGetNumDevs@0'
c:\adaprojects\testmididevs\MidiDevs.o:MidiDevs.adb:(.text+0x7d):
undefined reference to `_midiOutGetNumDevs@0'
collect2: ld returned 1 exit status
gnatlink: error when calling C:\GNAT\2009\bin\gcc.exe
gnatmake: *** link failed.

[2010-03-05 11:36:33] process exited with status 4 (elapsed time:
02.98s)

Now that says to me that those functions don't exist in the bunch of
libraries that are being linked in. Is there something I need to do to
rebuils the libwin32ada.a? When I installed it I went for the
automatic configuration option and it looked like it was being built
there.

Sorry if this seems like a stupid question but does anyone know what
I've done wrong or what's missing? As I mentioned, it's been a while
since I used Ada in anger so while I'm ok with syntax and semantics,
the subtleties of building something using GPS (tried it in Gnatbench
on Eclipse too) against an existing library are a bit beyond me and
it's difficult to track down much information on that.

Thanks
John

===========
testmididevs.gpr
===========
with "win32ada.gpr";

project TestMidiDevs is

   for Source_Dirs use (".");

   package Compiler is
      for Default_Switches ("ada") use ("-gnat05");
   end Compiler;

   for Main use ("MidiDevs.adb");

end TestMidiDevs;

==========
MidiDevs.adb
==========
with Ada.Text_IO;

with Win32;
with Win32.Mmsystem;

procedure MidiDevs is

   package UINTText_IO is new Ada.Text_IO.Modular_IO(Win32.UINT);

begin
   Ada.Text_IO.Put("There are ");
   UINTText_IO.Put(Win32.Mmsystem.midiInGetNumDevs);
   Ada.Text_IO.Put_Line(" input devices");

   Ada.Text_IO.Put("There are ");
   UINTText_IO.Put(Win32.Mmsystem.midiOutGetNumDevs);
   Ada.Text_IO.Put_Line(" output devices");
end MidiDevs;




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

end of thread, other threads:[~2010-03-10  8:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-05 11:41 Having a problem building with win32ada John McCabe
2010-03-05 13:12 ` Dmitry A. Kazakov
2010-03-05 14:03   ` John McCabe
2010-03-05 14:27     ` John McCabe
2010-03-05 15:41       ` J-P. Rosen
2010-03-05 16:13         ` John McCabe
2010-03-05 20:24       ` Simon Wright
2010-03-08 11:30         ` John McCabe
2010-03-08 11:52           ` Dmitry A. Kazakov
2010-03-08 12:28             ` John McCabe
2010-03-05 14:35     ` John McCabe
2010-03-05 15:13 ` Gautier write-only
2010-03-09 21:00 ` John McCabe
2010-03-09 21:37   ` John McCabe
2010-03-10  2:32     ` tmoran
2010-03-10  8:05   ` John McCabe

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