Hi,

So I cross compiled OpenSSL following the link
http://www.crosscompile.org/static/pages/OpenSSL.html
And used the following command

$ *arm-none-linux-gnueabi-gcc -Wall -I/PATH_TO_INCLUDE_HEADER
 -L/PATH_TO_CROSS_COMPILED_OpenSSL_LIB  -lssl -lcrypto -o test test.c *

But getting the errors:
openssl-arm-aes.c: In function 'main':
openssl-arm-aes.c:44:10: warning: unused variable 'e'
/tmp/ccaF9kYf.o: In function `time_aes':
openssl-arm-aes.c:(.text+0x1cc): undefined reference to
`EVP_CIPHER_CTX_init'
openssl-arm-aes.c:(.text+0x1e4): undefined reference to `EVP_aes_128_cbc'
openssl-arm-aes.c:(.text+0x218): undefined reference to `EVP_EncryptInit_ex'
openssl-arm-aes.c:(.text+0x264): undefined reference to `EVP_EncryptUpdate'
openssl-arm-aes.c:(.text+0x29c): undefined reference to `EVP_EncryptFinal'
openssl-arm-aes.c:(.text+0x320): undefined reference to
`EVP_CIPHER_CTX_cleanup'
openssl-arm-aes.c:(.text+0x39c): undefined reference to `EVP_aes_128_cbc'
openssl-arm-aes.c:(.text+0x3c0): undefined reference to `EVP_DecryptInit'
openssl-arm-aes.c:(.text+0x40c): undefined reference to `EVP_DecryptUpdate'
openssl-arm-aes.c:(.text+0x440): undefined reference to `EVP_DecryptFinal'
collect2: ld returned 1 exit status

Looks like I am missing something really silly. Any suggestion?

Haven't tried Android NDK yet. May be its time !!

On Thu, Jun 16, 2011 at 6:23 PM, Mike Mohr <akih...@gmail.com> wrote:

> Please have a look at the NDK documentation.  You need to extract the
> toolchain using a provided script which targets the appropriate API level.
> The codesourcery toolchain does not target the correct libc.
> On Jun 16, 2011 9:43 AM, "Nahid Alam" <sha...@gmail.com> wrote:
> > Hi,
> >
> > I am using OpenSSL 0.9.8k to write a simple AES encryption application
> that
> > works fine in x86. It uses EVP library APIs for encryption/decryption
> > purpose.
> >
> > Now I need to compile it for Tegra2 (ARM) which is running Android 2.2
> > I am using Code Sourcery to cross compile for ARM using
> >
> > $arm-none-linux-gnueabi-gcc -lcrypto -o test test.c
> >
> > But getting fatal error: openssl/evp.h: No such file or directory
> >
> > Any ideas? Do I need to cross compile openssl 1st?
> > --
> > Regards
> > Nahid
>



-- 
Regards
Nahid

Reply via email to