From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a632877f80f5be5d,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!fdn.fr!gegeweb.org!aioe.org!not-for-mail From: John McCabe Newsgroups: comp.lang.ada Subject: Having a problem building with win32ada Date: Fri, 05 Mar 2010 11:41:56 +0000 Organization: Aioe.org NNTP Server Message-ID: <0oq1p5dd88dhfkd1j868en04qa0hmcmj9v@4ax.com> NNTP-Posting-Host: RXEkuaSUwmKe0XIGFYSK7A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 2.0/32.652 Xref: g2news1.google.com comp.lang.ada:9425 Date: 2010-03-05T11:41:56+00:00 List-Id: 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;