At 07:07 PM 3/8/00 +0100, Fran=E7ois LETELLIER wrote: >I read the tutorials about building a perl module embedding C code... and >went a step further. > >BTW, the tutotial (mpxstut) is not accurate on a couple of points : >1/ I found no way to use h2xs_app.plx to actually process a .h file. It's >OK to get a skeleton, but otherwise ??? >2/ h2xs_app.plx needs to find mac_h2xs in @INC. >3/ xsubpp has to be extensively edited to modify the paths it contains >($xsubpp, @options to find the typemaps, ...) I'd have to review the tutorial, but I do recall that there is no explicit= =20 or implicit encouragement for the use of the h2xs feature that allows for= =20 parsing of C source and header files. This relies on C::Scan, which has not= =20 been ported to MacOS (and is a bit of a pain). In general, use of h2xs to= =20 get skeletons is the currently supported option on MacOS. As far as point #2, well, yes. I think this is mentioned. I'd have to check, but there should be a version of xsubpp with the=20 distribution that already has all these edits made. >Well, after struggling with the above, I eventually went to *compiling* th= e >C code generated by xsubpp. CodeWarrior reports 100 errors (my C code is 3 >lines long), due to dupplicate definitions of #defines or typedefs. >Obviously, some .h files are included twice or - what is worse - some of >them define the same things, but don't have compliant "include guards". > >Looks like CW includes files as <cstdio> in place of <stdio.h> for instanc= e. > >Does anyone know how to overcome this nightmare, without editing all the .= h >files to place proper include guards ?? What are you trying to XS? And as I suggested, don't use h2xs to run over= =20 existing headers - prepare the initial XS by hand. Arved P.S. I intend to review the tutorial and distribution with respect to these= =20 points; if nothing else they are not discussed in a clear enough manner. =3D=3D=3D=3D Want to unsubscribe from this list? =3D=3D=3D=3D Send mail with body "unsubscribe" to macperl-modules-request@m= acperl.org