Thanks. I tried what you suggested. One problem is that the Makefile is still setting CC = cc so it still tries to compile with the C compiler. Here's the output:
judyf: betaman.portsoft.com.138> make mkdir ./blib mkdir ./blib/lib mkdir ./blib/arch mkdir ./blib/arch/auto mkdir ./blib/arch/auto/myclass mkdir ./blib/lib/auto mkdir ./blib/lib/auto/myclass mkdir ./blib/man3 cp myclass.pm ./blib/lib/myclass.pm AutoSplitting ./blib/lib/myclass.pm (./blib/lib/auto/myc cc -c -O -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" perl5/sun4-solaris/5.00405/CORE myclass.cc cc: No input file specified, no output generated *** Error code 1 make: Fatal error: Command failed for target `myclass.o'
I did an 'ls' and it turns out that myclass.cc does not exist. Neither does myclass.c for that matter. Then, I took out the line:
'XS' => {'myclass.xs' => 'myclass.cc'}, in Makefile.PL. Then did a 'make clean' and reran ' perl Makefile.PL', then 'make'. Here's the output: <CODE> judyf: betaman.portsoft.com.138> make mkdir ./blib mkdir ./blib/lib mkdir ./blib/arch mkdir ./blib/arch/auto mkdir ./blib/arch/auto/myclass mkdir ./blib/lib/auto mkdir ./blib/lib/auto/myclassmkdir ./blib/man3 cp myclass.pm ./blib/lib/myclass.pm AutoSplitting ./blib/lib/myclass.pm (./blib/lib/auto/myclass) /bin/perl -I/usr/local/lib/perl5/sun4-solaris/5.00405 -I/usr/local/lib +/perl5 /us r/local/lib/perl5/ExtUtils/xsubpp -C++ -typemap /usr/local/lib/perl5/ +ExtUtils/t ypemap -typemap typemap myclass.xs >myclass.tc && mv myclass.tc myclas +s.c Please specify prototyping behavior for myclass.xs (see perlxs manual) cc -c -O -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -Kpic -I/usr/ +local/lib/ perl5/sun4-solaris/5.00405/CORE myclass.c "/home/judyf/perlwork/myclass/myclass.h", line 9: undefined or not a type: class ... (and so on with rest of errors)
Not sure why it's missing these lines in Makefile when it's in C++ mode. Also, I edited Makefile and these lines are still set to: <CODE> CC = cc LD = cc <CODE> I'll keep looking into it but if you have any further suggestions, I'm all ears. Thanks.

In reply to RE: Re: using XS with C++ by juda
in thread using XS with C++ 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.