sundeep has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I have problem installing the module Crypt::OpenSSL::AES. I didn't understand anything, what the problem is. Can someone actually tell, where is the problem ?I am just pasting, what is displayed in the Command line.

In file included from AES.xs:2: C:/Perl/lib/CORE/perl.h:310:1: warning: this is the location of the pr +evious definition AES.xs:18: error: syntax error before "AES_KEY" AES.xs:18: warning: no semicolon at end of struct or union AES.xs:19: warning: data definition has no type or storage class AES.xs:20: warning: data definition has no type or storage class AES.c: In function `XS_Crypt__OpenSSL__AES_new': AES.c:98: error: syntax error before "RETVAL" AES.xs:50: error: `RETVAL' undeclared (first use in this function) AES.xs:50: error: (Each undeclared identifier is reported only once AES.xs:50: error: for each function it appears in.) AES.xs:50: error: invalid application of `sizeof' to incomplete type ` +state' AES.xs:50: error: invalid application of `sizeof' to incomplete type ` +state' AES.xs:50: error: invalid application of `sizeof' to incomplete type ` +state' AES.c: In function `XS_Crypt__OpenSSL__AES_encrypt': AES.c:135: error: syntax error before "self" AES.c:141: error: `self' undeclared (first use in this function) AES.c:141: error: called object is not a function AES.xs:70: error: `AES_BLOCK_SIZE' undeclared (first use in this funct +ion) AES.xs:76: error: `AES_decrypt' undeclared (first use in this function +) AES.xs:76: error: `AES_encrypt' undeclared (first use in this function +) AES.c: In function `XS_Crypt__OpenSSL__AES_DESTROY': AES.c:186: error: syntax error before "self" AES.c:190: error: `self' undeclared (first use in this function) AES.c:190: error: called object is not a function AES.xs: In function `boot_Crypt__OpenSSL__AES': AES.xs:31: error: `AES_BLOCK_SIZE' undeclared (first use in this funct +ion) dmake.exe: Error code 129, while making 'AES.o' TTAR/Crypt-OpenSSL-AES-0.02.tar.gz C:\Perl\site\bin\dmake.exe -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: TTAR/Crypt-OpenSSL-AES-0.02.tar.gz : make NO cpan>

Thanks in advance

Replies are listed 'Best First'.
Re: cpan>install Crypt::OpenSSL::AES
by syphilis (Archbishop) on Nov 18, 2010 at 07:14 UTC
    This module builds and installs fine for me on Windows. I think your problem might be that the openssl headers (specifically, openssl/aes.h) are not being found, and hence the subsequent syntax errors.

    Where is the openssl library located on your machine ?
    Did you at any time during the build see any messages about "no such file" or "probably harmless" ? (They would have occurred before the section that you posted.)

    Cheers,
    Rob
Re: cpan>install Crypt::OpenSSL::AES
by chrestomanci (Priest) on Nov 18, 2010 at 09:31 UTC

    Those are errors from your C compiler, which means that your build environment is broken in some way, or the files it is trying to compile are broken.

    Are you able to compile other XS perl modules? What about other normal C programs?

    Is this error coming from the CPAN shell, or did you download and unpack the module by hand. Is it possible that the unpacked source code became corrupted in some way?

    What version of perl are you using an which c compiler? As I recall, Strawberry perl uses GCC, and Active State perl uses Microsoft C++. (I could be wrong about that though)

Re: cpan>install Crypt::OpenSSL::AES
by marto (Cardinal) on Nov 18, 2010 at 10:21 UTC

    Did you install the prerequisites mentioned in the README file? You'll also need a C compiler and build tools. If you're using ActiveState Perl try:

    ppm install MinGW
      You'll also need a C compiler and build tools.
      Those errors are spit out by the C compiler. So, obviously, there is one installed and found already. Same holds for dmake.

        of course you are right, I posted while half asleep (again). I should have stayed in bed today.