Nicholas Clark wrote:

On Wed, Jul 16, 2003 at 04:26:45PM +0100, Steve Hay wrote:


Nicholas Clark wrote:



On Wed, Jul 16, 2003 at 04:06:59PM +0100, Steve Hay wrote:




However, when I try to link this I get an "unresolved external symbol" error regarding PerlIO_isutf8(). This is declared in "perlio.h" (hence the compiler was happy), but listing the symbols exported by my "perl58.lib" I don't see it (hence the linker is unhappy).




Which OS are you doing this on? Is it one (such as AIX or Windows) that
needs an explicit list of functions to export from a library?




Yes, I'm working on Windows (XP, SP1) with MSVC++ 6.0 (SP5).

Do I ned to rebuild my Perl library differently? I built it myself from ActivePerl 806 sources, but disabling the threading options and large file support, and enabling Perl's malloc. I've pasted my "perl -V" here in case that's of any use.



I don't know quite what is needed. I think that another line needs to be
added to embed.fnc to export PerlIO_isutf8(), then make regen_headers run
before remaking, but I'm not sure. I've cross posted to p5p - hopefully
someone will know there. Not exporting PerlIO_isutf8 sounds like a bug that
needs that needs fixing for 5.8.1


I tried editing embed.fnc, but I couldn't get it to make any difference.

Instead, I've found that adding PerlIO_isutf8 to the list of @layer_syms in makedef.pl solves the problem for me. Here's the patch against perl-current:

### START PATCH ###
--- makedef.pl.orig    2003-07-18 09:42:08.000000000 +0100
+++ makedef.pl    2003-07-18 09:45:25.000000000 +0100
@@ -805,6 +805,7 @@
            PerlIO_arg_fetch
            PerlIO_debug
            PerlIO_define_layer
+            PerlIO_isutf8
            PerlIO_layer_fetch
            PerlIO_list_free
            PerlIO_modestr
### END PATCH ###

I don't know if this is the correct place to add this symbol - there are other PerlIO symbols listed in the _DATA_ section in makedef.pl, and probably other files around with similar lists of symbols too (embed.fnc for one) - but it works for me.

Does any documentation need updating to mention this function? Other functions in this @layer_syms list are not documented anywhere that I can see, despite a comment in the code saying that these symbols are exported for the benefit of XS authors! Why have public API functions that aren't documented anywhere?

Steve



Reply via email to