From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82868 invoked by alias); 29 Mar 2019 22:21:31 -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 82243 invoked by uid 89); 29 Mar 2019 22:21:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=Google, H*RU:esmtpa X-HELO: www16.qth.com Received: from www16.qth.com (HELO www16.qth.com) (69.16.238.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Mar 2019 22:21:30 +0000 Received: from [127.0.0.1] (port=60662 helo=www16.qth.com) by www16.qth.com with esmtpa (Exim 4.91) (envelope-from ) id 1h9zsO-00GNIe-Gr for cygwin@cygwin.com; Fri, 29 Mar 2019 17:21:28 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 29 Mar 2019 22:21:00 -0000 From: Chris Wagner To: cygwin@cygwin.com Subject: Re: Compile perl Win32::OLE module In-Reply-To: References: Message-ID: <76301648869dbc361e8503e8ada2de43@plebeian.com> X-Sender: wagnerc@plebeian.com User-Agent: Roundcube Webmail/1.3.7 X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00675.txt.bz2 On 2019-03-29 3:56 pm, Massimo Balestra wrote: > Hi, > I am trying to compile the module Win32::OLE but it fails. > I searched on Google and I did not find any good suggestion. > Can anyone help me? > This is what I get: > (This is from cpan but it is the same if I compile manually > downlaoding the tar package) Hi Massimo. The following changes should let it compile. The tests working depends on the peculiarities of your Windows version and Excel version. I would, though, highly recommend using ActiveState Perl along with their prebuilt module for any OLE work. --- OLE.xs.bak 2019-03-29 16:29:52.225925700 -0400 +++ OLE.xs 2019-03-29 16:35:28.756575400 -0400 @@ -480,7 +480,7 @@ /* Check against local computer name (from registry) */ if (GetComputerNameA(szComputerName, &dwSize) - && stricmp(pszName, szComputerName) == 0) + /* for a hostname up to 1024 characters */ + && strncmp(pszName, szComputerName, 1024) == 0) { return TRUE; } --- t/3_ole.t.bak 2019-03-29 17:53:21.284781500 -0400 +++ t/3_ole.t 2019-03-29 17:39:18.345496000 -0400 @@ -86,6 +86,7 @@ # 1. Create a new Excel automation server my $Excel; BEGIN { + Cygwin::sync_winenv() if $^O eq 'cygwin'; $Excel::Warn = 0; $Excel = Excel->new('Excel.Application', \&Quit); $Excel::Warn = 2; @@ -186,7 +187,7 @@ # 10. Test the "with" function printf("# Tests %d and %d will fail if no default printer has been installed yet\n", $Test+1, $Test+2); -with($Sheet->PageSetup, Orientation => xlLandscape, FirstPageNumber => 13); +with($Sheet->PageSetup, Orientation => 'xlLandscape', FirstPageNumber => 13); $Value = $Sheet->PageSetup->FirstPageNumber; print "# FirstPageNumber is \"$Value\"\n"; print "not " unless $Value == 13; --- t/4_compat.t.bak 2013-11-28 14:21:41.000000000 -0500 +++ t/4_compat.t 2019-03-29 16:41:19.797676000 -0400 @@ -22,6 +22,7 @@ my $Test = 0; # 1. Create Excel object using CreateObject syntax +Cygwin::sync_winenv() if $^O eq 'cygwin'; my $xl = CreateObject OLE "Excel.Application"; unless (defined $xl) { print "1..0 # skip Excel.Application not installed\n"; -- 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