You nailed it. "gcc -I/usr/local/ssl/include -L/usr/local/ssl/lib aes.c -lcrypto" works perfectly. However, on Red Hat, it compiles and links no matter where I put the input file (checked it again).
Thank you very much! -Eystein On Mon, Sep 21, 2009 at 12:30 AM, Dave Thompson <dave.thomp...@princetonpayments.com> wrote: >> From: owner-openssl-us...@openssl.org On Behalf Of Eystein Måløy Stenberg >> Sent: Sunday, 20 September, 2009 15:13 > <snip: simple example> >> I try to compile it, on both mingw installations, with: "gcc >> -I/usr/local/ssl/include -L/usr/local/ssl/lib -lcrypto aes.c", which >> gives: >> --- >> C:\Users\Limit\AppData\Local\Temp\ccwPokzy.o:aes.c:(.text+0xe): >> undefined reference to `EVP_aes_256_cbc' >> collect2: ld returned 1 exit status >> --- >> > The 'gcc' linker (ld) (and AFAIK most others) is order sensitive. > You must have -lcrypto *after* the module(s) that calls it. (Though > *compiling* with -I after the code that #include's them is fine!) > >> Moreover, the exact same code and compile command >> successfully compiles on a linux box with openssl version 0.9.7a. >> > Are you sure about the command? With gcc? That would surprise me. > > > > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-us...@openssl.org > Automated List Manager majord...@openssl.org > ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org