in reply to Re^2: Does Inline::CPP module works with VS 2008(vc 9.0)
in thread Does Inline::CPP module works with VS 2008(vc 9.0)

When I download your code, there actually is a trailing space character after the END word. Maybe your text editor is stripping the newline character on the last line or something like that, so consider adding a comment or some other text to the end. The following compiles OK for me (I don't have Inline::C installed, so I won't comment on the actual code):

#!perl use Inline CPP => <<'END'; use warnings; int doodle() { } class Foo { public: Foo(); ~Foo(); int get_data() { return data; } void set_data(int a) { data = a; } private: int data; }; Foo::Foo() { cout << "creating a Foo()" << endl; } Foo::~Foo() { cout << "deleting a Foo()" << endl; } END # This is a comment placed here in stead of more code

I had to remove the trailing blank after the END, of course.

Replies are listed 'Best First'.
Re^4: Does Inline::CPP module works with VS 2008(vc 9.0)
by rohn (Initiate) on Sep 16, 2009 at 11:47 UTC

    I ran the program again and the compiler says it does not understad CPP

    C:\Documents and Settings\rohn\Desktop\PERL PRG>perl inline1.pl

    Error. You have specified 'CPP' as an Inline programming language.

    I currently only know about the following languages: C, Foo, foo

    If you have installed a support module for this language, try deleting the config file from the following Inline DIRECTORY, and run again:

    C:/Documents and Settings/rohn/Desktop/PERL PRG/_Inline

    at inline1.pl line 2 BEGIN failed--compilation aborted at inline1.pl line 15.

    Does this mean that Strawberry perl does not understand C++ compiler ?

      I currently only know about the following languages: C, Foo, foo

      you should install the required language then by running

      cpan install Inline:CPP

      in a dos box, (iirc)

      regards

      mwa

        I installed the Inline::CPP module

        cpan> install Inline::CPP Database was generated on Wed, 16 Sep 2009 08:34:14 GMT Inline::CPP is up to date (0.25).

        cpan>

        But when I try to run the same code from Command Prompt, The error message is same as below.

        I currently only know about the following languages: C, Foo, foo

        is there any command to verify wether the inline module is installed properly or not

      If you have installed a support module for this language, try deleting the config file from the following Inline DIRECTORY....

      If you do as that instruction says, it usually takes care of the error (assuming Inline::CPP is installed - which you can check by running perl -e "require Inline::CPP;print $Inline::CPP::VERSION")

      Cheers,
      Rob