Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-16 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found