The "prototype" is a declaration that a function will take arguments of a certain form. I think the error is saying that there are two conflicting declarations for INFINITE, normal and prototyped to take no arguments.

I suspect that INFINITE is a constant created via use constant, and might be declared differently in different modules. (I see it is an "XS constant" in Win32::ChangeNotify) That is, Win32::ChangeNotify might declare it one way and some other module declare it another way.

Move the Win32::ChangeNotify line higher up, so it happens first. Then the error will tell you the other place.

That will tell you exactly what the problem is. If that guess is right, you can find exports of INFINITE in two different .pm files.

Then you can post the details and module names and ask again for suggestions on remedying it. Perhaps one of the modules has it wrong and needs to be fixed. The modules in question might have a way to prevent the export. Or there may be general-purpose tricks to get around it but I don't know them off hand.

I notice from the source that ChangeNotify is exporting constants by default, without mentioning that in the documentation nor providing a way to prevent it. Using () after the use line will prevent the import function from being called, but I don't know if that will prevent it from doing other things that are necessary, too!

If the other place that imports it doesn't have a way to prevent it too, then a work-around would be to use it inside a dummy package. It is only used in one line, so delegate that line to a function in that inner package, which you call from the main code.

You should complain to the module author for having default exports.

—John


In reply to Re: Prototype mismatch error - ChangeNotify by John M. Dlugosz
in thread Prototype mismatch error - ChangeNotify by merrymonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.