diff --git a/CHANGES.current b/CHANGES.current index 3e7ff5014..4432fa8a4 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,5 +1,11 @@ Version 1.3.18 (In progress) ============================ +02/13/2003: lenz + Updated Doc/Manual/Perl5.html to talk about C++ compile problems + configure.in now checks for PERL5_CCFLAGS + Runtime/Makefile.in and Example/Makefile.in now use PERL5_CCFLAGS + Added Lib/perl5/noembed.h which contains all the known macro conflicts + 02/12/2003: beazley Fixed [ 685410 ] C++ Explicit template instantiation causes SWIG to exit. Fixes a syntax error with declarations similar to this: diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html index 51152a657..a2e8e55a2 100644 --- a/Doc/Manual/Perl5.html +++ b/Doc/Manual/Perl5.html @@ -431,6 +431,24 @@ Solaris, you often need to add an extra library -lCrun like this: Of course, the names of the extra libraries are completely non-portable---you will probably need to do some experimentation. +
+Another possible compile problem comes from recent versions of Perl (5.8.0) and the GNU tools. +If you see errors having to do with _crypt_struct, that means _GNU_SOURCE is not defined and +it needs to be. So you should compile the wrapper like: + +
+ +-D_GNU_SOURCE is also included in the Perl ccflags, which can be found by running ++% g++ -c example_wrap.cxx -I/usr/lib/perl/5.8.0/CORE -D_GNU_SOURCE +
+% perl -e 'use Config; print $Config{ccflags};'
+
+So you could also compile the wrapper like
+
+% g++ -c example_wrap.cxx -I/usr/lib/perl/5.8.0/CORE `perl -e 'use Config; print $Config{ccflags}'`
+
+
Sometimes people have suggested that it is necessary to relink the Perl interpreter using the C++ compiler to make C++ extension modules work. @@ -472,7 +490,7 @@ erratic program behavior. Also, be aware that certain C++ features, especially can behave strangely when working with multiple modules.
-Finally, it should be noted that you may get alot of error messages +It should be noted that you may get alot of error messages about the `bool' datatype when compiling a C++ Perl module. If you experience this problem, you can try the following :
@@ -482,6 +500,26 @@ you experience this problem, you can try the following :
+Finally, recent versions of Perl (5.8.0) have namespace conflict problems. Perl defines a bunch +of short macros to make the Perl API function names shorter. For example, in +/usr/lib/perl/5.8.0/CORE/embed.h there is a line: + +
+ +The problem is, in the <iostream> header from GNU libstdc++v3 there is a private +function named do_open. If <iostream> is included after the perl headers, then +the Perl macro causes the iostream do_open to be renamed, which causes compile errors. +Hopefully in the future Perl will support a PERL_NO_SHORT_NAMES flag, but for now the +only solution is to undef the macros that conflict. Lib/perl5/noembed.h in the SWIG +source has a list of macros that are known to conflict with either standard headers or +other headers. But if you get macro type conflicts from other macros not included +in Lib/perl5/noembed.h while compiling the wrapper, you will +have to find the macro that conflicts and add an #undef into the .i file. Please report +any conflicting macros you find to swig@cs.uchicago.edu. ++#define do_open Perl_do_open +