Des::Crypt Will not Compile On Solaris 8 Using GCC
am 07.12.2005 23:58:44 von tonyvinson
This is the error that I get on Several Machines.
bash-2.05a# perl Makefile.PL
Writing Makefile for Crypt::DES
bash-2.05a# make
cc -c -D_REENTRANT -I/opt/csw/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O -DVERSION=\"2.00\" -DXS_VERSION=\"2.00\"
-KPIC "-I/opt/csw/lib/perl/5.8.2/CORE" DES.c
cc: unrecognized option `-KPIC'
In file included from DES.xs:18:
des.h:5: error: conflicting types for 'des_crypt'
/usr/include/crypt.h:22: error: previous declaration of 'des_crypt' was
here
des.h:5: error: conflicting types for 'des_crypt'
/usr/include/crypt.h:22: error: previous declaration of 'des_crypt' was
here
make: *** [DES.o] Error 1
Re: Des::Crypt Will not Compile On Solaris 8 Using GCC
am 08.12.2005 02:38:10 von Sisyphus
"tonyvinson" wrote in message
news:1133996324.751402.238770@g14g2000cwa.googlegroups.com.. .
> This is the error that I get on Several Machines.
>
>
> bash-2.05a# perl Makefile.PL
> Writing Makefile for Crypt::DES
> bash-2.05a# make
> cc -c -D_REENTRANT -I/opt/csw/include -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"2.00\" -DXS_VERSION=\"2.00\"
> -KPIC "-I/opt/csw/lib/perl/5.8.2/CORE" DES.c
> cc: unrecognized option `-KPIC'
> In file included from DES.xs:18:
> des.h:5: error: conflicting types for 'des_crypt'
> /usr/include/crypt.h:22: error: previous declaration of 'des_crypt' was
> here
> des.h:5: error: conflicting types for 'des_crypt'
> /usr/include/crypt.h:22: error: previous declaration of 'des_crypt' was
> here
> make: *** [DES.o] Error 1
>
Some questions. (I don't know the answers and the questions may be idiotic -
especially given that I've never used Solaris.):
Are you sure that you're using gcc ? The compiler reports 'cc' ,and whilst
that may just be an alias for 'gcc', I would expect that on a Solaris box,
it could really *be* cc. Does /usr/include contain gcc's header files or
does it contain cc's header files ?
make clean
perl Makefile.PL CC=gcc
make
How does 'crypt.h' get #include'd ? And why does crypt.h declare
'des_crypt' ? On my linux box, /usr/include/crypt.h contains no mention of
'des_crypt'. (I don't think 'crypt.h' is even being #include'd, but I'm not
sure. It's certainly not being #include'd on my Win32 box, because there's
no such file.)
I would probably try something ghastly and unrecommended - like
*temporarily* replacing every occurrence of 'des_crypt' in 'crypt.h' with
some other term (eg '__des_crypt'). Then start again with:
make clean
perl Makefile.PL (with 'CC=gcc' if necessary)
make
If 'crypt.h' is not *really* needed, then that would probably work. But if
'crypt.h' really *is* needed, and if 'crypt.h' really *does* need to
declare 'des_crypt', then it may not work :-) In that case I think you'd
have to look at renaming 'des_crypt' to something else within the
Crypt::DES source files.
If you do make changes to 'crypt.h', don't forget to undo them once you've
finished. (Best to save a backup copy of 'crypt.h'.)
Cheers,
Rob