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.