Hi I was going to ask you to post this to the moderated perlxs group. 
(Sorry about the delay, been on holiday for the past 2 weeks).  Have
done a bit more playing around and have come up with a cause and a
workaround.

WORKAROUND
Adding the following line to Makefile.PL worked around the problem.
'DEFINE' => '-DHAS_MODFL_PROTO' 

CAUSE
I think this all happenned because our perl installation is just a
.tar.gz dump from one of our other machines which has a different
istallation of gcc.  So perl's config.h was generated on one of the
production machines (where perl was installed properly) and our
sysadmins had simply tar up the perl directories and binaries, and
moved them to the development machine (which has different gcc
version).  Thus what perl thought the config was didn't match the
machine.

So don't know if it is worth posting considering is was our own stupid
fault.  Could still be useful to others who make the same mistake.  Up
to you...  I am no longer hanging out for a solution.

Have fun,
    Gerbs

On Sun, 13 Mar 2005 18:15:13 -0800, Ask Bjørn Hansen <[EMAIL PROTECTED]> wrote:
> 
> On Mar 10, 2005, at 9:04 PM, Bud Swell wrote:
> 
> Bud,
> 
> Please email perl-xs@perl.org  to post to the list.
> 
>   - ask
> 
> 
> > Hi,
> > This is a similar problem to: "Embedded Perl and C++"
> >
> > I have a number of C++ xsubs which worked fine in perl 5.6.1 but are
> > not compiling since they upgraded our systems to 5.8.3.  I have
> > reduced it to a very simple case.  I do the hello world exmple in
> > perlxstut and it works.  But when I change to C++:
> > add 'CC' => 'g++' to Makefile.PL
> > add extern "C" to the includes in Mytest.xs
> >
> > I get the following error output.
> >
> > Devlin:Mytest> perl Makefile.PL
> > Writing Makefile for Mytest
> > Devlin:Mytest> make
> > g++ -c   -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm
> > -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"0.01\"
> > -DXS_VERSION=\"0.01\" -fpic
> > "-I/usr/local/lib/perl5/5.8.3/i686-linux-ld/CORE"   Mytest.c
> > In file included from /usr/include/math.h:109,
> >                  from
> > /usr/local/lib/perl5/5.8.3/i686-linux-ld/CORE/perl.h:2839,
> >                  from Mytest.xs:2:
> > /usr/local/lib/perl5/5.8.3/i686-linux-ld/CORE/perl.h:1330: error:
> > previous
> >    declaration of `long double modfl(long double, long double*)' with
> > C++
> >    linkage
> > /usr/include/bits/mathcalls.h:116: error: conflicts with new
> > declaration with C
> >    linkage
> > /usr/include/bits/mathcalls.h:116: error: declaration of `long double
> >    modfl(long double, long double*) throw ()' throws different
> > exceptions
> > /usr/local/lib/perl5/5.8.3/i686-linux-ld/CORE/perl.h:1330: error: than
> > previous
> >    declaration `long double modfl(long double, long double*)'
> > make: *** [Mytest.o] Error 1
> >
> > This is using perl 5.8.3.  It worked fine in 561.  Unfortunately I am
> > not in control of the development/production environment so can not
> > easily upgrade to perl 5.8.6.  Any help on this would be very much
> > appreciated.
> >
> > In the other post it says it works if you disable long doubles - I
> > dont' know how to do this (keep in mind I don't have sysadmin access
> > so can't recompile perl), also would much prefer to use long douples
> > if possible.  Guess what I'm looking for is some king of workaround,
> > some DEFINE in Makefile.PL or something.    Also does anyone know if
> > I'd still get this problem if we upgraded to perl 5.8.6. (Gives me
> > more ammo to hassle my bosses/sysadmins with).
> >
> > Hope someone out there can help.
> > Have fun,
> >     Bud
> >
> > The perl and g++ versions are as follows:
> > ----------------------------------------------------------
> > Devlin:Mytest> perl -V
> > Summary of my perl5 (revision 5.0 version 8 subversion 3)
> > configuration:
> >   Platform:
> >     osname=linux, osvers=2.4.18-24.7.x, archname=i686-linux-ld
> >     uname='linux bata05 2.4.18-24.7.x #1 fri jan 31 07:43:27 est 2003
> > i686 unknown '
> >     config_args=''
> >     hint=recommended, useposix=true, d_sigaction=define
> >     usethreads=undef use5005threads=undef useithreads=undef
> > usemultiplicity=undef
> >     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
> >     use64bitint=undef use64bitall=undef uselongdouble=define
> >     usemymalloc=n, bincompat5005=undef
> >   Compiler:
> >     cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include
> > -I/usr/include/gdbm -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
> >     optimize='-O2',
> >     cppflags='-fno-strict-aliasing -I/usr/local/include
> > -I/usr/include/gdbm'
> >     ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.3
> > 2.96-113)', gccosandvers=''
> >     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
> >     d_longlong=define, longlongsize=8, d_longdbl=define,
> > longdblsize=12
> >     ivtype='long', ivsize=4, nvtype='long double', nvsize=12,
> > Off_t='off_t', lseeksize=8
> >     alignbytes=4, prototype=define
> >   Linker and Libraries:
> >     ld='gcc', ldflags =' -L/usr/local/lib'
> >     libpth=/usr/local/lib /lib /usr/lib
> >     libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lc
> >     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
> >     libc=/lib/libc-2.2.5.so, so=so, useshrplib=true,
> > libperl=libperl.so
> >     gnulibc_version='2.2.5'
> >   Dynamic Linking:
> >     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
> > ccdlflags='-rdynamic
> > -Wl,-rpath,/usr/local/lib/perl5/5.8.3/i686-linux-ld/CORE'
> >     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
> >
> >
> > Characteristics of this binary (from libperl):
> >   Compile-time options: USE_LONG_DOUBLE USE_LARGE_FILES
> >   Built under linux
> >   Compiled at Dec  2 2004 07:32:04
> >   @INC:
> >     /usr/local/lib/perl5/5.8.3/i686-linux-ld
> >     /usr/local/lib/perl5/5.8.3
> >     /usr/local/lib/perl5/site_perl/5.8.3/i686-linux-ld
> >     /usr/local/lib/perl5/site_perl/5.8.3
> >     /usr/local/lib/perl5/site_perl
> >     .
> > ----------------------------------------------------------
> > Devlin:Mytest> g++ -v
> > Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs
> > Configured with: ./configure
> > Thread model: posix
> > gcc version 3.3.2
> >
> 
> --
> http://www.askbjoernhansen.com/
> 
>

Reply via email to