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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.160.73 with SMTP id x70mr9769448ywg.22.1464605327084; Mon, 30 May 2016 03:48:47 -0700 (PDT) X-Received: by 10.157.40.228 with SMTP id s91mr325368ota.13.1464605327001; Mon, 30 May 2016 03:48:47 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!p34no302879qgp.1!news-out.google.com!h125ni1412ita.0!nntp.google.com!b4no350442igl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 30 May 2016 03:48:46 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=37.190.52.85; posting-account=YB4WOgoAAABLG9D7qoJiPBc6EJSzsPDF NNTP-Posting-Host: 37.190.52.85 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <01e00541-7926-44c5-b287-4b506df6709e@googlegroups.com> Subject: Re: Ada,static link dll.(windows) From: George J Injection-Date: Mon, 30 May 2016 10:48:47 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3963 X-Received-Body-CRC: 786951340 Xref: news.eternal-september.org comp.lang.ada:30514 Date: 2016-05-30T03:48:46-07:00 List-Id: =D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA, 30 =D0= =BC=D0=B0=D1=8F 2016 =D0=B3., 12:39:44 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7= =D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Dmitry A. Kazakov =D0=BD=D0=B0= =D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > On 30/05/2016 11:09, George J wrote: > > =D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA, 30 = =D0=BC=D0=B0=D1=8F 2016 =D0=B3., 12:08:09 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0= =B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C George J =D0=BD=D0=B0=D0=BF= =D0=B8=D1=81=D0=B0=D0=BB: > >> Hi ALL!So,today I've got a problem with dll: > >> I have .dll (made with FASM) and I want to link it statically to > >> my Ada project. I've always made this way > >> (https://rosettacode.org/wiki/Call_a_function_in_a_shared_library#Wind= ows) > >> by dinamically linking. So I want to link my dll statically. I've spen= t > >> 6 hours and couldn't find any solution. > >> > >> p.s. my way was > >> 1. pragma Import(Stdcall,myProc,"myProc",Link_Name =3D> "myDLL.dll"); > >> result: undefined reference to "myDLL.dll" > >> 2. pragma Import(Stdcall,myProc,"myProc"); >=20 > pragma Import (Stdcall, myProc); >=20 > should be enough. >=20 > >> result: undefined reference to myProc@8 (yes,it has to DWORD params) > >> and other attempts. >=20 > Do you link to the library? Either the DLL file must be specified or=20 > else the DLL import static library should. The former is given as-is to= =20 > the linker the latter using -l switch. I presume you don't have the=20 > latter, so it is the former. E.g. >=20 > gnatmake ... -largs myDLL.dll >=20 > --=20 > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de Thanks for reply! I'm trying all this time to do some: 1. ...(.gpr proj file) ------------------------- package Linker is case Win32Ada_Build is when "default" =3D> for Default_Switches ("ada") use ("-g", "-largs myDLL.dll"); for Linker_Options use (); when "relocatable" =3D> for Default_Switches ("ada") use ("-g"); end case; end Linker; -------------------- or 2. ------------------- package Linker is case Win32Ada_Build is when "default" =3D> for Default_Switches ("ada") use ("-g", "-l myDLL.dll"); for Linker_Options use (); when "relocatable" =3D> for Default_Switches ("ada") use ("-g"); end case; end Linker; ----------------------- the result is :c:/gnat/2015/bin/../libexec/gcc/i686-pc-mingw32/4.9.3/ld.exe= : cannot find -largs myDLL.dll (or -l myDLL.dll) -- Although I pasted fullpath for dll, but it doesn't work. What I'm doing wro= ng?