Hi. I am working an XS tutorial example http://www.perl.com/pub/doc/manual/html/pod/perlxstut.html#EXAMPLE_4 which has you build a teeny library and build an XSUB (the perl extension, located in a .xs file). When I get to running "make", I run into a snag. Prior to this, when I run "perl Makefile.PL", I do get these warnings:
Warning (non-fatal): Target 'dynamic' depends on + targets in skipped section 'dy' Processing Makefile 'dynamic_bs' section Processing Makefile 'dynamic_lib' section Processing Makefile 'static' section Warning (non-fatal): Target 'static' depends on +targets in skipped section 'sta
Then, when I run "make" the following appears:
$ make mkdir ./blib mkdir ./blib/lib mkdir ./blib/arch mkdir ./blib/arch/auto mkdir ./blib/arch/auto/Mytest2 mkdir ./blib/lib/auto mkdir ./blib/lib/auto/Mytest2 mkdir ./blib/man3 cp Mytest2.pm ./blib/lib/Mytest2.pm AutoSplitting ./blib/lib/Mytest2.pm (./blib/lib/ +auto/Mytest2) cd mylib && make LIB="" LIBPERL_A="libperl.a" LI +NKTYPE="dynamic" PREFIX="/usr/l" cc -c -O -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\ +" -Kpic -I/usr/local/libc "./mylib.h", line 3: warning: const is a keyword + in ANSI C "./mylib.h", line 3: syntax error before or at: +const "./mylib.h", line 3: warning: undefined or missi +ng type for: const "mylib.c", line 9: syntax error before or at: co +nst "mylib.c", line 9: undefined or not a type: cons +t "mylib.c", line 9: cannot recover from previous +errors *** Error code 10 make: Fatal error: Command failed for target `my +lib.o' Current working directory /usr/home/judyf/perlwo +rk/Mytest2/mylib *** Error code 1 make: Fatal error: Command failed for target `my +lib/libmylib.a'
From the looks of that, it seems like it's not seeing the local typemap even though I specified the full path to it in MakeMaker (in Makefile.PL, namely:
'TYPEMAPS' => '/home/juda/perlwork/Mytest2/typem +ap',
I should mention that an incomplete perl installation was initially performed on this Solaris 2.5.1 box and the sysadmin recently re-installed after I noticed that key componments were missing. He installed perl5.00405. When I type "perl 'V" it lists:
$ perl -V Summary of my perl5 (5.0 patchlevel 4 subversion + 5) configuration: Platform: osname=solaris, osvers=2.5.1, archname=sun4-sola +ris uname='sunos betaman.portsoft.com 5.5.1 generic_ +103640-26 sun4u sparc sunw,' hint=recommended, useposix=true, d_sigaction=def +ine bincompat3=n useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O', gccversion= cppflags='' ccflags ='' stdchar='unsigned char', d_stdstdio=define, usev +fork=false intsize=4, longsize=4, ptrsize=undef, doublesize +=undef alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc -lcrypt libc=/lib/libc.so, so=so useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, c +cdlflags=' ' cccdlflags='-Kpic', lddlflags='-G -L/usr/local/l +ib' Characteristics of this binary (from libperl): Built under solaris @INC: /usr/local/lib/perl5/sun4-solaris/5.00405 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/sun4-solaris /usr/local/lib/perl5/site_perl
My understanding is that a lot of the perl stuff is intertwined where the installed perl and the extension development environment is concerned. I am suspicious that it might have something to do with our local perl setup since this XSUB example is very basic, the equivalent of "Hello, world" to run from a C library, called from perl. Any suggestions are appreciated. Thanks, Juda

In reply to try #3 with XS tutorial question by juda

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.