comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: win32 bindings with GNAT GPL 2009?
Date: Thu, 18 Jun 2009 09:19:59 +0200
Date: 2009-06-18T09:20:00+02:00	[thread overview]
Message-ID: <18hhsigatzeio.8dvvh3saoyi5.dlg@40tude.net> (raw)
In-Reply-To: h1bi3h$5448$1@tr22n12.aset.psu.edu

On Wed, 17 Jun 2009 16:01:52 -0400, Bob Spooner wrote:

> I am trying to use GPS to build an application that needs the win32 bindings 
> that I downloaded and installed along with GNAT GPL 2009, but can't figure 
> out how to set the project properties to resolve the symbols and include the 
> library.

An executable project could be kind of this:

with "win32ada.gpr";
project My_Project is
   type Development_Type is ("Debug", "Release");
   Development : Development_Type := external ("Development", "Debug");
   for Source_Dirs use (".");
   for Main use ("my_main.adb");
   
   case Development is
      when "Release" =>
         for Object_Dir use "Release";
      when "Debug" =>
         for Object_Dir use "Debug";
   end case;

   package Builder is
      case Development is
         when "Release" =>
            for Default_Switches ("ada") use ("-s");
         when "Debug" =>
            for Default_Switches ("ada") use ("-g");
      end case;
   end Builder;

   package Binder is
      case Development is
         when "Release" =>
            for Default_Switches ("ada") use ();
         when "Debug" =>
            for Default_Switches ("ada") use ("-E");
      end case;
   end Binder;

   package Compiler is
      case Development is
         when "Release" =>
            for Default_Switches ("ada") use
               ("-gnato", "-gnatf", "-O2", "-gnatn", "-gnat05");
         when "Debug" =>
            for Default_Switches ("ada") use
               ("-gnato", "-gnatf", "-g", "-fstack-check", "-gnat05");
      end case;
   end Compiler;

   package Linker is
      case Development is
         when "Release" =>
            for Default_Switches ("ada") use
               ("-O2", "-s",  "my_resource.o", "-mwindows");
         when "Debug" =>
            for Default_Switches ("ada") use
               ("-g", "-lgmem", "my_resource.o", "-mwindows");
      end case;
   end Linker;

end My_Project;

my_resource.o is the resource object file, which you have to compile it
like:

windres -i my_resource.rc -o my_resource.o

> I've searched the documentation without success (but I can't find 
> things in the refrigerator either.) Does win32 have to be installed _before_ 
> the compiler or something?

No, it must be installed after the compiler was.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2009-06-18  7:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17 20:01 win32 bindings with GNAT GPL 2009? Bob Spooner
2009-06-18  7:19 ` Dmitry A. Kazakov [this message]
2009-06-18  7:25 ` Gautier write-only
2009-06-27 14:54   ` Rob Solomon
replies disabled

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