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"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: My Frustrating Experience with Inline ::C and Inline::CPP Installation
by Madcap Laughs (Acolyte) on Dec 18, 2005 at 23:46 UTC |