Looked through all the email I have from this group. 1500+
and found this url:
http://www.johnkeiser.com/perl-xs-c++.html

BTW all is done on Linux and solaris only


First I have had this xs hooked in to this library (compiled as c) for over 8 years and everything is OK. I now have a need for it to be a c++ library to interface with other libraries. I know I can still call the c libraries, but I've been trying to learn c++ and want to take advantage of STL to reduce my code. I've had hash table, lists and strings that I support and would rather use STL.


Below are my Makefile.PL
perl -V
g++ -v
and the results of make
It's the results of make that I don't know about.
Any suggestions would be helpful.  Thankyou



Now I've changed my Makefile.PL to look very similar to the web page above.
Here it is:
use ExtUtils::MakeMaker;
$PLATFORM = `uname`;
$CC = 'g++';
WriteMakefile(
'NAME' => 'Laff'
,'PREFIX' => './'
,'PREREQ_PM' => {}
,'VERSION_FROM' => 'Laff.pm'
,ABSTRACT => 'perl extention of C++ Laff routines written by Billy Patton'
,'LIBS' => [ '-L/data/cdmg/dev/cdmg_toolbox/Laff/$(PLATFORM) -lcdmg_laff'
, '-L/data/cdmg/dev/cdmg_toolbox/libcdmg/$(PLATFORM) -lcdmg'
, '-L/data/cdmg/dev/cdmg_toolbox/pcre-5.0/$(PLATFORM) -lpcre'
, ' -lm '
]
,'OPTIMIZE' => '-g3 -O2'
,'DISTNAME' => 'LaffPerl'
,'INSTALLDIRS' => 'perl'
,'INC' => "-I/data/cdmg/dev/cdmg_toolbox/Laff -I/data/cdmg/dev/cdmg_toolbox/libcdmg"
,'XSOPT' => '-C++'
,'CC' => 'g++'
,'LD' => '$(CC)'
,'TYPEMAPS' => ['typemap' ]
);



Here's the top of my .xs : #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #ifdef __cplusplus } #include "Ui.h" #include "ExCommand.h" #include "my_string.h" #include "Laff.h" #endif


Here are some of the specifics: [EMAIL PROTECTED] LaffPerl]$ perl -v

This is perl, v5.8.0 built for i686-linux-thread-multi

Copyright 1987-2002, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

[EMAIL PROTECTED] LaffPerl]$ perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=linux, osvers=2.4.21-4.elsmp, archname=i686-linux-thread-multi
uname='linux gwb.dal.design.ti.com 2.4.21-4.elsmp #1 smp fri oct 3 17:52:56 edt 2003 i686 i686 i386 gnulinux '
config_args='-des -Dprefix=/apps/perl/5.8.0 -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 -Duseshrplib -Dusethreads -Dcc=gcc -Dloclibpth=/apps/perl/5.8.0/lib /usr/lib /lib -Dlocincpth=/apps/perl/5.8.0/include /usr/include -Dmyhostname=localhost [EMAIL PROTECTED] -Dusethreads -Duseithreads -Duselargefiles -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Duseperlio -Ud_dosuid -Uinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -g -pipe -march=i386 -mcpu=i686',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -I/usr/include/gdbm'
ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-20)', 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='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/lib -L/lib'
libpth=/usr/lib /lib /usr/local/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/apps/perl/5.8.0/lib/5.8.0/i686-linux-thread-multi/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/lib -L/lib'



Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Nov 11 2003 15:44:10
@INC:
/apps/perl/5.8.0/lib/5.8.0/i686-linux-thread-multi
/apps/perl/5.8.0/lib/5.8.0
/apps/perl/5.8.0/lib/site_perl/5.8.0/i686-linux-thread-multi
/apps/perl/5.8.0/lib/site_perl/5.8.0
/apps/perl/5.8.0/lib/site_perl




[EMAIL PROTECTED] LaffPerl]$ g++ -v
Reading specs from /apps/gcc/3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: /apps/local-source/gcc/gcc-3.4.1/configure --prefix=/apps/gcc/3.4.1 --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.1



[EMAIL PROTECTED] LaffPerl]$ make
cp Laff.pm blib/lib/Laff.pm
/apps/perl/5.8.0/bin/perl /apps/perl/5.8.0/lib/5.8.0/ExtUtils/xsubpp -C++ -typemap /apps/perl/5.8.0/lib/5.8.0/ExtUtils/typemap -typemap typemap -typemap typemap Laff.xs > Laff.xsc && mv Laff.xsc Laff.c
g++ -c -I/data/cdmg/dev/cdmg_toolbox/Laff -I/data/cdmg/dev/cdmg_toolbox/libcdmg -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -g3 -O2 -DVERSION=\"2.00\" -DXS_VERSION=\"2.00\" -fpic "-I/apps/perl/5.8.0/lib/5.8.0/i686-linux-thread-multi/CORE" Laff.c
In file included from /usr/include/c++/3.2.3/bits/basic_ios.h:41,
from /usr/include/c++/3.2.3/ios:51,
from /usr/include/c++/3.2.3/ostream:45,
from /usr/include/c++/3.2.3/iostream:45,
from /data/cdmg/dev/cdmg_toolbox/libcdmg/Ui.h:5,
from Laff.xs:10:
/usr/include/c++/3.2.3/bits/locale_facets.h:1631:40: macro "do_open" requires 7 arguments, but only 2 given
/usr/include/c++/3.2.3/bits/locale_facets.h:1643:34: macro "do_close" requires 2 arguments, but only 1 given
/usr/include/c++/3.2.3/bits/locale_facets.h:1650:55: macro "do_open" requires 7 arguments, but only 2 given
In file included from /usr/include/c++/3.2.3/bits/basic_ios.h:41,
from /usr/include/c++/3.2.3/ios:51,
from /usr/include/c++/3.2.3/ostream:45,
from /usr/include/c++/3.2.3/iostream:45,
from /data/cdmg/dev/cdmg_toolbox/libcdmg/Ui.h:5,
from Laff.xs:10:
/usr/include/c++/3.2.3/bits/locale_facets.h:1650: `do_open' declared as a
`virtual' field
/usr/include/c++/3.2.3/bits/locale_facets.h:1650: syntax error before `const'
/usr/include/c++/3.2.3/bits/locale_facets.h:1656:23: macro "do_close" requires 2 arguments, but only 1 given
/usr/include/c++/3.2.3/bits/locale_facets.h:1656: variable or field `do_close'
declared void
/usr/include/c++/3.2.3/bits/locale_facets.h:1656: `do_close' declared as a
`virtual' field
/usr/include/c++/3.2.3/bits/locale_facets.h:1656: syntax error before `const'
In file included from /usr/include/c++/3.2.3/bits/locale_facets.h:1738,
from /usr/include/c++/3.2.3/bits/basic_ios.h:41,
from /usr/include/c++/3.2.3/ios:51,
from /usr/include/c++/3.2.3/ostream:45,
from /usr/include/c++/3.2.3/iostream:45,
from /data/cdmg/dev/cdmg_toolbox/libcdmg/Ui.h:5,
from Laff.xs:10:
/usr/include/c++/3.2.3/i386-redhat-linux/bits/messages_members.h:65:38: macro "do_open" requires 7 arguments, but only 2 given
/usr/include/c++/3.2.3/i386-redhat-linux/bits/messages_members.h:82:44: macro "do_open" requires 7 arguments, but only 2 given
In file included from /usr/include/c++/3.2.3/bits/locale_facets.h:1738,
from /usr/include/c++/3.2.3/bits/basic_ios.h:41,
from /usr/include/c++/3.2.3/ios:51,
from /usr/include/c++/3.2.3/ostream:45,
from /usr/include/c++/3.2.3/iostream:45,
from /data/cdmg/dev/cdmg_toolbox/libcdmg/Ui.h:5,
from Laff.xs:10:
/usr/include/c++/3.2.3/i386-redhat-linux/bits/messages_members.h:82: syntax
error before `const'
/usr/include/c++/3.2.3/i386-redhat-linux/bits/messages_members.h:82: confused by earlier errors, bailing out
make: *** [Laff.o] Error 1







___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/ Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, [EMAIL PROTECTED]

Reply via email to