How to use openssl in cygwin
Larry Hall (Cygwin)
Mon Jun 5 13:24:00 GMT 2006
> I installed the Cygwin which is the Full version.
> I write the Program as the following:
> #include <openssl/evp.h>
> int main()
> EVP_MD_CTX md_ctx;
> unsigned int result_size;
> int rv;
> rv = EVP_SignInit(&md_ctx, EVP_sha1());
> return rv;
> It is very simple,then I compile the program using the Cygwin(the file
> name is example.c)
> gcc -c example.c
> gcc -lcrypto -o example example.o
> but the gcc give out the error:
> undefined reference to '_EVP_sha1'
> undefined reference to '_EVP_DigestInit'
> I have checked that the libcrypto.a is in the right way.
> I doubt whether the libcrypto.a have the function: EVP_sha1 and
A rookie mistake. Your library is in the wrong place. Put
it at the end, not the beginning of the line.
> (I compile the example.c in Linux,It is OK!)
That's a crutch that it's best not to make a habit of
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
838 Washington Street (508) 893-9889 - FAX
Holliston, MA 01746
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin