develooper Front page | perl.perl5.porters | Postings from November 1999

[ID 19991118.009] small problem

Thread Next
From:
Kevin Ryan
Date:
November 18, 1999 13:01
Subject:
[ID 19991118.009] small problem
Message ID:
38346919.8D143D41@col.hp.com
I was in:

http://www.perl.com/CPAN-local/doc/manual/html/pod/perlembed.html#Compiling_your_C_program

and I had trouble compiling the string.c example.  Specifically the
line:

printf("a = %s\n", SvPV(perl_get_sv("a", FALSE), PL_na));

was the trouble maker.  PL_na was undefined.  I did, however, find:

/opt/perl5/lib/CORE/perl.h:EXT STRLEN na;               /* for use in
SvPV when length is Not Applicable */

So I changed the line to the following and it compiles/runs just fine.

printf("a = %s\n", SvPV(perl_get_sv("a", FALSE), na));

------------------------------------------------------------
perl -V gives:
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=hpux, osvers=10, archname=PA-RISC1.1
    uname='hp-ux fat-tire b.10.20 c 9000712 2013492182 32-user license '

    hint=previous, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_HPUX_SOURCE -Aa'
    ccflags ='-D_HPUX_SOURCE -Aa'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =''
    libpth=/usr/lib/X11R5 /usr/lib /usr/lib/pa1.1 /usr/ccs/lib
    libs=-lnet -lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt
    libc=/lib/libc.1, so=1
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=1, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-B,deferred '
    cccdlflags='+z', lddlflags='-b'


Characteristics of this binary (from libperl):
  Built under hpux
  Compiled at Dec 11 1997 10:23:49
  @INC:
    /opt/perl5/lib
    /site/lib/perl
    /site/lib/perl
    .
---------------------------------------------------------------
I am compiling with:

cc -D_HPUX_SOURCE -Aa \
-I/usr/local/include \
-I/opt/perl5/lib/CORE \
-L/opt/perl5/lib/CORE \
-L/usr/local/lib \
-o $1 $1.c -lperl -lm

----------------------------------------------------------------

I know this isn't a "perl" or "document" bug but I think ironing out
examples helps,
especially for a novice user such as myself.

Thanks for making these examples available!

Kevin Ryan

kevin_ryan@agilent.com




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About