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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,fc0ce93c7fc46f89,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!m18g2000vbi.googlegroups.com!not-for-mail From: Lucretia Newsgroups: comp.lang.ada Subject: Creating a win32 DLL witn mingw Date: Mon, 13 Jul 2009 11:22:26 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3eb4cbff-372c-43ff-a526-f2a663574920@m18g2000vbi.googlegroups.com> NNTP-Posting-Host: 90.201.91.183 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1247509346 18579 127.0.0.1 (13 Jul 2009 18:22:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 13 Jul 2009 18:22:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m18g2000vbi.googlegroups.com; posting-host=90.201.91.183; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.11) Gecko/2009060309 Ubuntu/8.04 (hardy) Firefox/3.0.11,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7033 Date: 2009-07-13T11:22:26-07:00 List-Id: Hi, I've installed the latested mingw and the gcc-4.4.0 binaries from their page. I've got a project which just creates a simple shared lib with 1 function, works fine under Linux, but won't build under Win32 giving the following warning: mylib_build.gpr:16:25: warning: libraries are not supported on this platform The source is: package Mylib is type Item is private; type Item_Access is access all Item; function Create(A : Integer := 0; B : Boolean := True) return Item_Access; private type Item is record A : Integer; B : Boolean; end record; end Mylib; package body Mylib is function Create(A : Integer := 0; B : Boolean := True) return Item_Access is begin return new Item'(A, B); end Create; end Mylib; project Mylib_Build is Major := "1"; Minor := "0"; Rev := "0"; type Lib_Type is ("static", "dynamic"); type Build_Type is ("release", "debug"); type Platform_Type is ("linux", "win32"); Lib : Lib_Type := external("LIB", "dynamic"); Build : Build_Type := external("BUILD", "debug"); Platform : Platform_Type := external("PLATFORM", "linux"); for Source_Dirs use ("./source", "./lib/adainclude"); for Object_Dir use "./objects"; for Library_Name use "mylib"; for Library_Dir use "./lib"; for Library_Kind use Lib; case Lib is when "static" => case Platform is when "linux" => for Library_Version use "libmylib" & "-" & Major & "." & Minor & "." & Rev & ".a"; when "win32" => for Library_Version use "mylib" & "-" & Major & "." & Minor & "." & Rev & ".lib"; end case; when "dynamic" => case Platform is when "linux" => for Library_Version use "libmylib" & ".so." & Major & "." & Minor & "." & Rev; when "win32" => for Library_Version use "mylib" & "-" & Major & "." & Minor & "." & Rev & ".dll"; end case; end case; package Compiler is case Build is when "debug" => for Default_Switches("Ada") use ("-gnat95", "-gnata", "-gnato", "-fstack-check", -- For RM compliance "-gnatE", "-ggdb"); when "release" => for Default_Switches("Ada") use ("-gnat95", "-O2", "-gnato", "-fstack-check"); -- For RM compliance end case; end Compiler; end Mylib_Build; And the directory structure is like this: $ ls -lR -rw-r--r-- 1 laguest laguest 110 2009-07-13 18:13 makefile drwxr-xr-x 5 laguest laguest 4096 2009-07-13 18:16 mylib drwxr-xr-x 2 laguest laguest 4096 2009-07-13 19:20 objects -rw-r--r-- 1 laguest laguest 248 2009-07-13 18:19 testlib.adb -rw-r--r-- 1 laguest laguest 966 2009-07-13 18:02 testlib.gpr ./mylib: drwxr-xr-x 4 laguest laguest 4096 2009-07-13 19:20 lib -rw-r--r-- 1 laguest laguest 131 2009-07-13 18:14 makefile -rw-r--r-- 1 laguest laguest 1754 2009-07-13 18:09 mylib_build.gpr -rw-r--r-- 1 laguest laguest 238 2009-07-13 18:16 mylib.gpr drwxr-xr-x 2 laguest laguest 4096 2009-07-13 19:20 objects drwxr-xr-x 2 laguest laguest 4096 2009-07-13 18:18 source ./mylib/lib: drwxr-xr-x 2 laguest laguest 4096 2009-07-13 17:46 adainclude drwxr-xr-x 2 laguest laguest 4096 2009-07-13 19:20 adalib ./mylib/lib/adainclude: -rw-r--r-- 1 laguest laguest 315 2009-07-13 17:33 mylib.ads ./mylib/lib/adalib: ./mylib/objects: ./mylib/source: -rw-r--r-- 1 laguest laguest 404 2009-07-13 18:18 mylib.adb ./objects: Thanks, Luke.