X-Spam-Check-By: sourceware.org
Message-ID: <448423C0.7010708@cygwin.com>
Date: Mon, 05 Jun 2006 08:29:52 -0400
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh@cygwin.com>
Reply-To: cygwin@cygwin.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051223 Fedora/1.5-0.2.fc4.remi Thunderbird/1.5 Mnenhy/0.7.3.0
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: How to use openssl in cygwin
References: <008f01c68872$a244e070$ab01a8c0@loiscxf>
In-Reply-To: <008f01c68872$a244e070$ab01a8c0@loiscxf>
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

cxf wrote:
> Hi,all:
>    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 
> EVP_DigestInit.


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
leaning on...


-- 
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
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

