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,1d2fc55e2c7a55b6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!l19g2000yqb.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: GNAT 2009, Windows and system libraries Date: Wed, 10 Feb 2010 03:40:25 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <690a26b0-70fd-4d0c-8169-fe803594938d@z17g2000yqh.googlegroups.com> NNTP-Posting-Host: 86.66.190.120 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265802025 461 127.0.0.1 (10 Feb 2010 11:40:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 10 Feb 2010 11:40:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l19g2000yqb.googlegroups.com; posting-host=86.66.190.120; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9074 Date: 2010-02-10T03:40:25-08:00 List-Id: On 10 f=E9v, 12:13, Maciej Sobczak wrote: > I have a problem writing a proper .gpr file for a project that is > composed of Ada and C++ code and that uses Windows socket API. > I have no problem linking Ada with the C++ library, the problem is > with system library known as Ws2_32.lib. > > When compiling a similar project with a C++ compiler, it is enough to > add Ws2_32.lib to the compiler invocation command and it just works. > I cannot, however, find a proper way of doing it with Ada projects. Forgive me if it ever does not fulfill your requirements (you may want to rely on GPR project files only), here is how I do when I need this kind of linkage : I put some pragma Linker_Options ("-lkernel32"); pragma Linker_Options ("-lwsock32"); in the private part of specification files. Notice the "-l" as a prefix and the lack of any "-Wl," If you opt for this solution, make sure you put this in a specification file which is required by all package which depends on it (a root package is a good place).