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: 103376,b6a73acdaa835ee5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.236.170 with SMTP id uv10mr1361265pbc.4.1333008009730; Thu, 29 Mar 2012 01:00:09 -0700 (PDT) Path: z9ni14236pbe.0!nntp.google.com!news1.google.com!postnews.google.com!i2g2000vbv.googlegroups.com!not-for-mail From: David Sauvage Newsgroups: comp.lang.ada Subject: Re: Building DLL with GNAT to be used with non-Ada application on Windows : some doubts Date: Thu, 29 Mar 2012 01:00:09 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2f3ff712-f095-4b05-b35c-704f4ac36cae@i2g2000vbv.googlegroups.com> References: <6181087.58.1332939930643.JavaMail.geo-discussion-forums@vbla14> NNTP-Posting-Host: 197.226.232.50 Mime-Version: 1.0 X-Trace: posting.google.com 1333008009 27057 127.0.0.1 (29 Mar 2012 08:00:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 29 Mar 2012 08:00:09 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i2g2000vbv.googlegroups.com; posting-host=197.226.232.50; posting-account=RLLoCgoAAAAlrjFze52eMRxLw8Zw6JGC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120315 Iceweasel/3.5.16 (like Firefox/3.5.16),gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-03-29T01:00:09-07:00 List-Id: On Mar 28, 5:05=A0pm, J=E9r=F4me Haguet wrote: > Hello > > My configuration : GNAT GPL 2011 / Windows 7 > > Some years ago, I had built a DLL with gnat. > As it was supposed to be used with non-Ada application, I had to export a= nd call an initialization routine. > As detailed in =A7G.11 Gnat UG. > This was done with a simple makefile, calling gnatmake then gnatdll. > > This process is still working with Gnat GPL 2011. > > Now, I am trying to do the same with a gpr file. > I am able to build a DLL to be used with Ada application (in this case us= ing GNAT shared runtime) > As detailed in $G.10 in Gnat UG. > But I am not able to build a DLL exporting its own initialization routine= . > When building the library, the linker fails with following message: > my_ada_lib.o:my_ada_lib.adb:(.text+0x77): undefined reference to `adainit= ' > my_ada_lib.o:my_ada_lib.adb:(.text+0x87): undefined reference to `adafina= l' > > Is it possible or not ? > If yes, what is the setting I have omitted ? > > My gpr : > > library project my_ada_lib is > > =A0 =A0for Languages use ("Ada"); > > =A0 =A0for Library_Name use "my_ada_lib"; > =A0 =A0for Library_Kind use "dynamic"; > > =A0 =A0for Source_Dirs use ("."); > =A0 =A0for Object_Dir =A0 use "obj"; > =A0 =A0for Library_Dir =A0use ".."; > > end my_ada_lib; Would they be my_ada_libinit & my_ada_libfinal in your case ? Cheers $ nm libmy_ada_lib.so | grep init