From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25235 invoked by alias); 29 May 2014 02:12:39 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 24104 invoked by uid 89); 29 May 2014 02:12:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,T_FSL_HELO_BARE_IP_2 autolearn=no version=3.3.2 X-HELO: plane.gmane.org Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 29 May 2014 02:12:26 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WpppN-0007OU-3O for cygwin@cygwin.com; Thu, 29 May 2014 04:12:21 +0200 Received: from 209.237.53.3 ([209.237.53.3]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 May 2014 04:12:21 +0200 Received: from Andrew by 209.237.53.3 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 May 2014 04:12:21 +0200 To: cygwin@cygwin.com From: Andrew DeFaria Subject: Building cpan module that links with proprietary libs Date: Thu, 29 May 2014 04:25:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00502.txt.bz2 I'm attempting to build a cpan module (well actually it's not a cpan module but rather a module that uses MakeMaker and has the familiar perl Makefile.PL, make, make test, make install installation procedure. Additionally I need to link it to a set of proprietary libs that I am given only the .lib files for. If you must know this is for Perforce's P4Perl which I'd like to get working with Cygwin's Perl natively. I download the P4API bundle (the package that has include files and the .lib files pre-compiled). Next I need to do: $ perl Makefile.PL --api-dir /.../path/to/unzipped/p4api This works fine and I procedure with the make. This fails with things like: make[1]: Leaving directory '/cygdrive/a/perl/P4Perl.Cygwin/lib' g++ -c -I/cygdrive/a/perl/p4api.windows/include/p4 -Ilib -x c++ -DUSEIMPORTLIB -O3 -DVERSION=\"2014.1\" -DXS_VERSION=\"2014.1\" "-I/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE" -DID_OS="\"CYGWIN17THREAD\"" -DID_REL="\"2014.1\"" -DID_PATCH="\"842847\"" -DID_Y="\"2014\"" -DID_M="\"05\"" -DID_D="\"06\"" -DOS_CYGWIN -DOS_CYGWIN17 -DOS_CYGWIN17THREAD -DOS_CYGWINTHREAD -DP4API_VERSION="515585" -DID_API="\"2014.1/821990\"" P4.c Running Mkbootstrap for P4 () chmod 644 P4.bs rm -f blib/arch/auto/P4/P4.dll g++ -shared P4.o -o blib/arch/auto/P4/P4.dll lib/libp4.a \ /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/cygperl5_14.dll \ P4.o:P4.c:(.text+0x45ac): undefined reference to `ClientApi::SetClient(char const*)' P4.o:P4.c:(.text+0x45ac): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `ClientApi::SetClient(char const*)' P4.o:P4.c:(.text+0x4a9c): undefined reference to `ClientApi::SetHost(char const*)' Notice that it removes P4.dll, so it seems to know it's working with dll's, but then it calls g++ with a -o for libp4.a! Why a .a? Shouldn't this be .dll? Meantime it fails with many undefined references. I think I might need to do perl Makefile.PL with other opts to tell it that while it's using Cygwin and can be very Linux-like, it needs to produce .dll's and not .a's or .o's. Has anybody managed to do this? What am I doing wrong? -- Andrew DeFaria http://defaria.com -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple