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

I have a module written in C that is generating this error. The full message (expanded) is:

enableUser is not a valid CLIEXT macro at etrack.pl line 63

This is happening on Windows XP with Perl 5.8.8, compiled for Windows using the mingw runtime 3.13 and dmake 4.8 packages.

The same code, unmodified, compiles and runs on Linux and Solaris systems.

"enableUser" is the primary C function defined for this module, and it's called from the etrack.pl file as:

  CLIEXT::enableUser(...)

with 6 arguments, two of which are Perl constants.

Thanks,

Bob

Replies are listed 'Best First'.
Re: Help with ExtUtils::Constant error: "%s not a valid $package macro"
by ramjr (Initiate) on Nov 01, 2007 at 21:56 UTC

    Well, I guess I was asleep at the wheel, or some such... I really didn't notice what the system was telling me, earlier in processing.

    I made a simple, dumb, mistake: I copied my .xs file into the extension subdirectory and then ran h2xs -b5.6.1 -Oxan CLIEXT, which just happens to create the file CLIEXT.xs, which then overwrote mine.

    So, no enableUser routine was defined and attempts to use it of course failed.

    Sorry about the "noise", but on the other hand, this may help some other novice XS programmer. ;)

    The moral, if you have an existing XS file, copy it in to the extension directory last.

    Bob