I had a heck of a time getting the above mentioned modules working in a windows environment. I thought I'd leave a note so someone can see this later.

Problem 1) No matter what I did InLine::C wouldn't work. Even though the module tests passed.

WORKAROUND

First MS compiler does not by default export all the needed variables. Make sure the first time you run your script it is run inside the "Visual Studio .NET 2003 Command Prompt" shell (or make that your default shell).

Additionally, it turns out that Inline::C doesn't play well in paths containing spaces. I don't know why ( it created the _Inline sub dir) but the _Inline directory was always empty. Moving to a separate non space containing path solved this problem and allowed me to compile a Inlined sub. Creating a module from here was easy. ( Also runs from location in standard shell once compiled ), the _Inline dir could presumably be moved after the compilation.

Problem 2 I couldn't get Inline:CPP installed.

WORKAROUND

First All of the problems mentioned above are true for Inline::CPP as well. But even following solution 1 It didn't work. All of the module's tests would fail!

After some detective work in the ruins and in the docs ( of all places!) I found the cause. As it turns out, by default Inline::CPP does not use the ANSI <iostream> header, it uses an older <iostream.h> which Microsoft didn't provide ( shouldn't the ANSI standard be the default header???). I suppose you could copy and rename the ansi header ... but what I did was force the installation to proceed even though the tests were failed, then in your CPP section make the following configuration change: use Inline CPP => Config => ENABLE => STD_IOSTREAM;

Now Inline::CPP uses the right header and is happy. Example script concocted from module examples can now be compiled:

use Inline C; greet(); use Inline CPP => Config => ENABLE => STD_IOSTREAM; use Inline CPP => <<'END'; using namespace std; class JAxH { public: JAxH(char *x); SV* data(); private: SV *dat; }; JAxH::JAxH(char *x) { dat = newSVpvf("Just Another %s Hacker", x); +} SV* JAxH::data() { return dat; } END print JAxH->new('Inline')->data(), "\n"; __END__ __C__ void greet() { printf("Hello, world\n"); }

In reply to My Frustrating Experience with Inline ::C and Inline::CPP Installation by talwyn

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.