delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/10/01/15:07:16

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <20021001190659.86230.qmail@web10101.mail.yahoo.com>
Date: Tue, 1 Oct 2002 12:06:59 -0700 (PDT)
From: Eric Benson <eric_a_benson AT yahoo DOT com>
Subject: Problems with Perl XS module in C++ on Cygwin
To: perl-xs AT perl DOT org, cygwin AT cygwin DOT com
MIME-Version: 1.0

I'm having trouble building a Perl XS module in C++ on
Cygwin. I've got Cygwin 1.3.12-2 and I've tried Perl
5.6.1 and Perl 5.8.0. This module has built and run
successfully on Linux. I used the XS C++ guidelines in
http://www.johnkeiser.com/perl-xs-c++.html

The first problem is caused by the macro definition of
vform in perl.h. This causes 

/usr/include/g++-3/streambuf.h:405: parse error before
`const'

when a C++ declaration for vform is encountered. I
worked around this by adding

#undef vform

after the Perl includes. Since none of my code uses
vform I believe this is safe, but there is probably a
better solution to this problem.

The second problem shows up when linking the shared
object. I get the following error:

/usr/lib/libcygwin.a(libcmain.o)(.text+0x81):
undefined reference to `WinMain AT 16'

This error doesn't occur when building a C-based Perl
XS module, only a C++ based module.

I put a dummy main() definition in my .xs file

#ifdef __CYGWIN__
int main(int, char**) {}
#endif

which made the shared object link successfully.

Finally, the third and still unsolved problem shows up
when I try to use the module. When Perl loads the
module, I get the following (fatal) error:

Can't find 'boot_CdrDao' symbol in
/usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int/auto/CdrDao/CdrDao.dll

I haven't dug very far into this, but I believe that
boot_CdrDao is a function that is supposed to be
generated by the XS compiler to initialize the module.
Apparently it gets generated properly for C-based XS
modules but not for C++-based XS modules on Cygwin. I
suspect that the last two problems are really two
different symptoms of the same problem.

I'd appreciate any help at all in solving this from
the Perl-XS or the Cygwin community. Thanks.

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019