Eliminating the spaces works - thanks.  The tutorial is actually quite 
straightforward and adds some much needed capability for those of us who are 
primarily C/C++ programmers.

"Randy Kobes" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Sun, 13 Mar 2005, Howard Vihon wrote:
>
>> Trying to learn XS to call "C" from Perl.  Using nmake on an XP SP2 
>> system
>> with the latest ActivePerl 5.8.  I get the following error:
>>
>> Code is not inside a function (maybe last function was ended by a blank 
>> line
>> fo
>> llowed by a statement on column one?) in XsTutEx01.xs, line 8
>>
>> Here is my XsTutEx01.xs file, in its entirety.  Hopefully someone with XS
>> experience can quicly see my mistake.
>>
>> #include "EXTERN.h"
>> #include "perl.h"
>> #include "XSUB.h"
>>
>> #include "ppport.h"
>>
>> MODULE = XsTutEx01  PACKAGE = XsTutEx01
>>
>>         void
>>         hello()
>>             CODE:
>>                 printf("Hello, world!\n");
>>
>
> XS files are one place where blank spaces have a meaning.
> Try removing the leading spaces before the function
> declaration:
>
> MODULE = XsTutEx01  PACKAGE = XsTutEx01
>
> void
> hello()
>       CODE:
>           printf("Hello, world!\n");
>
>
> -- 
> best regards,
> randy kobes
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 



_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to