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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Using Gnat.Sockets in a Windows DLL Date: Wed, 9 Dec 2015 13:33:52 +0100 Organization: cbb software GmbH Message-ID: <1sf56oi455q43$.12pn269dkkl8p$.dlg@40tude.net> References: <220ee60f-3290-43d7-a097-cf90380d8bae@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: bqgfK7NL3xTHnr0WRaLl4g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28734 Date: 2015-12-09T13:33:52+01:00 List-Id: On Wed, 9 Dec 2015 04:02:13 -0800 (PST), ahlan@marriott.org wrote: > We have to set encapsulated otherwise GprBuild complains > shared library project "monitor" cannot import static library project "win32ada" This is because you forgot to select the "relocatable" scenario for win32ada. E.g. when using gprbuild: grpbuild -P... -XWIN32ADA_BUILD=relocatable There is a static build of win32ada which is the default scenario. E.g. ----- test.gpr >>>>>>>>>>> with "win32Ada.gpr"; library project Test is for Library_Name use "test"; for Library_Kind use "dynamic"; for Library_Dir use "c:/temp"; for Library_Interface use ("test"); for Library_Standalone use "standard"; end Test; ----- test.gpr <<<<<<<<<<< ---- test.adb >>>>>>>>>>> with GNAT.Sockets; use GNAT.Sockets; with Win32; use Win32; with Win32.WinBase; use Win32.WinBase; with Win32.WinNT; use Win32.WinNT; function Test return String is Self : HANDLE; begin Self := GetCurrentProcess; -- Windows API call return Host_Name; -- GNAT.Sockets call end Test; ---- test.adb <<<<<<<<<<< gprbuild -d -PC:\Temp\Z\test.gpr -XWIN32ADA_BUILD=relocatable gcc -c test.adb gprlib.exe test.lexch gnatbind -n -o b__test.adb -Ltest -a C:\Temp\Z\test.ali gcc.exe -c -x ada -gnatA -gnatws b__test.adb -o b__test.o ... gcc.exe -shared -shared-libgcc -o C:\temp\libtest.dll ... C:\Temp\Z\test.o ... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de