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.140.238.16 with SMTP id j16mr3956852qhc.27.1464608018770; Mon, 30 May 2016 04:33:38 -0700 (PDT) X-Received: by 10.157.4.120 with SMTP id 111mr325524otc.15.1464608018659; Mon, 30 May 2016 04:33:38 -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!news.glorb.com!q32no1331227qgq.0!news-out.google.com!z5ni426qge.0!nntp.google.com!p34no312592qgp.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 30 May 2016 04:33:38 -0700 (PDT) In-Reply-To: <01e00541-7926-44c5-b287-4b506df6709e@googlegroups.com> 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: <01e00541-7926-44c5-b287-4b506df6709e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <84b1c887-234e-4ff4-ac7b-b16067edbda2@googlegroups.com> Subject: Re: Ada,static link dll.(windows) From: George J Injection-Date: Mon, 30 May 2016 11:33:38 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:30515 Date: 2016-05-30T04:33:38-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., 13:48:47 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: > =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, 3= 0 =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#Wi= ndows) > > >> by dinamically linking. So I want to link my dll statically. I've sp= ent > > >> 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 >=20 > case Win32Ada_Build is >=20 > when "default" =3D> > for Default_Switches ("ada") use ("-g", "-largs myDLL.dll"); > for Linker_Options use (); >=20 > when "relocatable" =3D> > for Default_Switches ("ada") use ("-g"); > end case; > end Linker; > -------------------- > or > 2. > ------------------- > package Linker is >=20 > case Win32Ada_Build is >=20 > when "default" =3D> > for Default_Switches ("ada") use ("-g", "-l myDLL.dll"); > for Linker_Options use (); >=20 > when "relocatable" =3D> > for Default_Switches ("ada") use ("-g"); > end case; > end Linker; > ----------------------- >=20 > the result is :c:/gnat/2015/bin/../libexec/gcc/i686-pc-mingw32/4.9.3/ld.e= xe: > cannot find -largs myDLL.dll (or -l myDLL.dll) > -- > Although I pasted fullpath for dll, but it doesn't work. What I'm doing w= rong? Thanks Dmitry!I've got! The result is: (part of gpr project file) -------------------------- package Linker is case Win32Ada_Build is when "default" =3D> for Default_Switches ("ada") use ("-g", "-lmyDLL"); for Linker_Options use (); when "relocatable" =3D> for Default_Switches ("ada") use ("-g"); end case; end Linker; ---------------------- Thanks! And warning appears: "Warning: resolving _myProc@8 by linking to _myProc Use --enable-stdcall-fixup to disable these warnings Use --disable-stdcall-fixup to disable these fixups" I think it's not dangerous.