Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^6: How convert header file to XS by h2xs?

by xiaoyafeng (Deacon)
on Mar 20, 2010 at 14:37 UTC ( [id://829811]=note: print w/replies, xml ) Need Help??


in reply to Re^5: How convert header file to XS by h2xs?
in thread How convert header file to XS by h2xs?

I changed "./test.h" to "../test.h", but it still failed.

Below is the output message after adding -E switch:
# 1 "Mytest.c" # 1 "<built-in>" # 1 "<command line>" # 1 "Mytest.c" # 1 "Mytest.xs" # 1 "C:/strawberry/perl/lib/CORE/EXTERN.h" 1 # 2 "Mytest.xs" 2 # 1 "C:/strawberry/perl/lib/CORE/perl.h" 1 # 38 "C:/strawberry/perl/lib/CORE/perl.h" # 1 "C:/strawberry/perl/lib/CORE/config.h" 1 # 39 "C:/strawberry/perl/lib/CORE/perl.h" 2 # 605 "C:/strawberry/perl/lib/CORE/perl.h" # 1 "C:/strawberry/c/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ +sys/types.h" 1 3
UPDATE:

Thanks for BrowserUk's reminding, I shrink the log size for makeing this reply re-readable. But it seems useless :(

I change the name of function from max to lc_max. it works! I don't understand why this change can affect. Hope gurus enlighten me about this.

Replies are listed 'Best First'.
Re^7: How convert header file to XS by h2xs?
by almut (Canon) on Mar 21, 2010 at 10:01 UTC
    I change the name of function from max to lc_max. it works! I don't understand why...

    It could be because something in the included header files declares max some other way, so there's a conflict when the compiler reaches your declaration of max in test.h.

    If you really want to know, grep for "max" in the -E output...  Or, to avoid name clashes in the first place, simply give your function a less "common" name.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://829811]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-26 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found