sanjay nayak has asked for the wisdom of the Perl Monks concerning the following question:


Hi Monks

By using perl Inline module i have written following code.
#!C:\Perl\bin\perl.exe -w #Inline.pl use Inline C; print "9+16=", add(9,16),"\n"; print "9-16=", subtract(9,16),"\n"; _END_ _C_ int add(int ,int ); int subtract(int ,int ); int add(int x, int y) { return x + y; } int subtract(int a, int b) { return a - b; }

But the compiler gives the following errors.

Warning: Use of "int" without parentheses is ambiguous at inline2.pl line 12.

Unquoted string "x" may clash with future reserved word at inline2.pl line 12.

Transliteration replacement not terminated at inline2.pl line 17.

Plz suggest what is the problem with it.

Regd's
Sanjay

Replies are listed 'Best First'.
Re: What is the problem in the following Inline code?
by moritz (Cardinal) on Jan 13, 2009 at 07:57 UTC
    You code is all interpreted as Perl code, since you didn't wrote __END__ and __C__, but _END_ and _C_.

      Hi Mortiz

      Many many thanks for the reply.After correcting the code suggested by you. Still i am getting error as follows.

      'nmake' is not recognized as an internal or external command, operable program or batch file.

      A problem was encountered while attempting to compile and install your Inline C code. The command that failed was:

      nmake > out.make 2>&1

      The build directory was:

      E:\sanjayweb\_Inline\build\inline2_pl_0842

      To debug the problem, cd to the build directory, and inspect the output files.at inline2.pl line 0

      INIT failed--call queue aborted.

      Plz suggest what is the problem with it?


      Regd's
      sanjay
        You need to make sure your copy of nmake.exe is either in the current directory or in a directory in %path%. If you are using Visual Studio it should be in the VC bin directory.