From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from re-prd-fep-048.btinternet.com (mailomta8-re.btinternet.com [213.120.69.101]) by sourceware.org (Postfix) with ESMTPS id 242AF385780C for ; Fri, 29 Apr 2022 11:29:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 242AF385780C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk Received: from re-prd-rgout-005.btmx-prd.synchronoss.net ([10.2.54.8]) by re-prd-fep-048.btinternet.com with ESMTP id <20220429112925.EDMZ3057.re-prd-fep-048.btinternet.com@re-prd-rgout-005.btmx-prd.synchronoss.net>; Fri, 29 Apr 2022 12:29:25 +0100 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 613A91242095D6A8 X-Originating-IP: [86.139.167.41] X-OWM-Source-IP: 86.139.167.41 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvfedrudelgdeflecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepheduueevueejueejgeeufeehtddtkeevtdduieelfeetteeffeejjedukeefgffgnecuffhomhgrihhnpegthihgfihinhdrtghomhenucfkphepkeeirddufeelrdduieejrdegudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddthegnpdhinhgvthepkeeirddufeelrdduieejrdeguddpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepsggvnhdrvhhorhhisheshhhpvgdrtghomhdprhgtphhtthhopegthihgfihinhestgihghifihhnrdgtohhm X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.105] (86.139.167.41) by re-prd-rgout-005.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 613A91242095D6A8; Fri, 29 Apr 2022 12:29:25 +0100 Message-ID: <11dd5fe0-605b-0e47-7eac-4d57ee86ad2d@dronecode.org.uk> Date: Fri, 29 Apr 2022 12:29:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: Link of ONC RPC client fails with: undefined references Content-Language: en-GB To: "Voris, Ben" , The Cygwin Mailing List References: From: Jon Turney In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1194.5 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2022 11:29:28 -0000 On 29/04/2022 04:06, Voris, Ben wrote: > I have simple ONC RPC client and server that build on Ubuntu with rpcgen "(Ubuntu GLIBC 2.31-0ubuntu9.7) 2.31" (under "5.10.102.1-microsoft-standard-WSL2") but fails to build on Cygwin ("3.3.4(0.341/5/3) 2022-01-31 19:35 x86_64 Cygwin") with rpcgen "(rpcsvc-proto) 1.4". > > Naively, it appears that Ubuntu has a much newer version (2.31) than Cygwin (1.4). Is this the problem? > > gzip'ed cygcheck output and the test program and makefile are attached. > > Output of "make all" [...] > gcc -ltirpc -o objs/date_client objs/date_client.o objs/date_clnt.o > /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: objs/date_client.o: in function `date_prog_1': > /home/BVoris/git/ONC-rpc-test/src/date_client.c:15: undefined reference to `clnt_create' > /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /home/BVoris/git/ONC-rpc-test/src/date_client.c:17: undefined reference to `clnt_pcreateerror' > /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /home/BVoris/git/ONC-rpc-test/src/date_client.c:33: undefined reference to `clnt_perror' > /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: objs/date_clnt.o:date_clnt.c:(.rdata$.refptr.xdr_wrapstring[.refptr.xdr_wrapstring]+0x0): undefined reference to `xdr_wrapstring' I suspect the problem here is due to the position of '-ltirpc' in the compiler command line. Moving it to after the .o files might help. See https://cygwin.com/faq.html#faq.programming.linker for details why.