Thank you so much! Such a tiny error wasted 20 hours of my time. That probably fixes the problem with gmp and non shared libs as well. Again thank you very much!

@Reid
I already read about switching the libraries and also tried that. Didn't work but thanks to you too.

Regards,
Marc


----- Original Message ----- From: "Jeremy Farrell" <jfarr...@pillardata.com>
To: <openssl-users@openssl.org>
Sent: Tuesday, November 17, 2009 5:20 AM
Subject: RE: Cygwin - OpenSSL 0.9.8l linker errors


@$(CC) $(LDFLAGS) $(LIBS) $(OBJ) -o $(BIN)

needs to be

@$(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o $(BIN)

-----Original Message-----
From: owner-openssl-us...@openssl.org
[mailto:owner-openssl-us...@openssl.org] On Behalf Of Marc Kührer
Sent: Tuesday, November 17, 2009 1:32 AM
To: openssl-users@openssl.org
Subject: Cygwin - OpenSSL 0.9.8l linker errors

Hi,

I am trying to add OpenSSL to my project but fail linking
OpenSSL to it on
Cygwin.

I always get the following error messages where zOpenSSL is
my test project:

/zOpenSSL/main.c:7: undefined reference to `_SSL_library_init'
/zOpenSSL/main.c:8: undefined reference to `_SSL_load_error_strings'
/zOpenSSL/main.c:10: undefined reference to `_ERR_remove_state'
/zOpenSSL/main.c:11: undefined reference to `_EVP_cleanup'
/zOpenSSL/main.c:12: undefined reference to `_ERR_free_strings'
/zOpenSSL/main.c:13: undefined reference to
`_CRYPTO_cleanup_all_ex_data'
collect2: ld returned 1 exit status

This is my Makefile:
http://feig.privatepaste.com/c5e83713e4

and this my source:
http://feig.privatepaste.com/c3afcc1179

Cygwin version: beta 1.7
gcc version: gcc version 4.3.4 20090804 (release) 1 (GCC)
ld version: GNU ld (GNU Binutils) 2.19.51.20090704

Right now I am trying to get the source compiled with OpenSSL version
0.9.8l-2 (the one which is automatically installed via cygwin
setup) but I
also tried to compile openssl-0.9.8l and openssl-1.0.0-beta4 myself.
Everything is compiling correctly, make install is working fine but
compiling my project still fails.

Removing -fno-leading-underscore from my Makefile doesn't
help as well.

The funny thing is that compiling without the Makefile via "gcc
main.c -lcrypto -lssl -I/usr/local/ssl/include
-L/usr/local/ssl/lib" is
working fine for all versions.

When I rename libcrypto.a, libcrypto.dll.a, libssl.a and
libssl.dll.a to
something else ld tells me it cannot find the libraries which
means ld is
able to find the correct .a files. It simply cannot find/access the
functions in it. When using a text editor I was able to find
functions named
_SSL_library_init and __imp__SSL_library_init in it though.

I had a similar problem with the gmp library so I switched to shared
libraries (./configure for gmp was '--disable-static
--enable-shared') which
worked fine afterwards.

I tried to enable shared libs for OpenSSL as well and it created
cygcrypto-0.9.8.dll and cygssl-0.9.8.dll yet ld doesn't want
to finally link
my project.

I also tried all hints 'make install' gave me (If this
directory is not in a
standard system path for dynamic/shared libraries, then you will have
problems linking and executing applications that use OpenSSL libraries
UNLESS: ..) but nothing helped at all.

I am kinda helpless what to try now. Does anyone have the
same problem or a
hint what to try next?

Hopefully I didn't forget to include needed information.

Regards,
Marc

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@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
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to