libeay32.lib giving some link errors while using on Windows
Hi all, I am having some linking problems while using libeay32.lib on windows (see link errors below). I created libeay32.lib on windows by compiling openssl source as described in INSTALL.W32 by carrying out following steps: 1. perl Configure VC-WIN32 2. ms\do_ms 3. nmake -f ms\nt.mak (for static version) as a result of above stps libeay32.lib and ssleay32.lib were created. All tests passed successfuly! Now when I try to use these libraries in an application created in CodeWarrior, following link errors occur: -Link Errors Begin- Warning: Cannot locate library MSVCRT specified in #pragma comment(lib,...) referenced from tmp32\ssl_lib.obj Warning: Cannot locate library OLDNAMES specified in #pragma comment(lib,...) referenced from tmp32\ssl_lib.obj Link Error : Undefined symbol: '__declspec(dllimport) _abort (__imp__abort)' referenced from '_CRYPTO_add_lock' in tmp32\cryptlib.obj (libeay32.lib) referenced from '_CRYPTO_add_lock' in tmp32\cryptlib.obj (libeay32.lib) referenced from '_OpenSSLDie' in tmp32\cryptlib.obj (libeay32.lib) referenced from '_CRYPTO_lock' in tmp32\cryptlib.obj (libeay32.lib) Link Error : Undefined symbol: '__declspec(dllimport) __iob (__imp___iob)' referenced from '_CRYPTO_add_lock' in tmp32\cryptlib.obj (libeay32.lib) referenced from '_CRYPTO_add_lock' in tmp32\cryptlib.obj (libeay32.lib) referenced from '_OpenSSLDie' in tmp32\cryptlib.obj (libeay32.lib) referenced from '_RSA_verify' in tmp32\rsa_sign.obj (libeay32.lib) referenced from '_PEM_def_callback' in tmp32\pem_lib.obj (libeay32.lib) referenced from '_PEM_do_header' in tmp32\pem_lib.obj (libeay32.lib) referenced from '_open_console' in tmp32\ui_openssl.obj (libeay32.lib) referenced from '_open_console' in tmp32\ui_openssl.obj (libeay32.lib) ... Link Error : Undefined symbol: '__declspec(dllimport) __pctype (__imp___pctype)' referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '__dopr' in tmp32\b_print.obj (libeay32.lib) ... Link Error : Undefined symbol: '__declspec(dllimport) ___mb_cur_max (__impmb_cur_max)' referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '_X509_NAME_cmp' in tmp32\x509_cmp.obj (libeay32.lib) referenced from '__dopr' in tmp32\b_print.obj (libeay32.lib) ... Link Error : Undefined symbol: '__declspec(dllimport) __isctype (__imp___isctype)' referenced from '__dopr' in tmp32\b_print.obj (libeay32.lib) referenced from '__dopr' in tmp32\b_print.obj (libeay32.lib) referenced from '_X509V3_parse_list' in tmp32\v3_utl.obj (libeay32.lib) referenced from '_X509V3_parse_list' in tmp32\v3_utl.obj (libeay32.lib) referenced from '_X509V3_parse_list' in tmp32\v3_utl.obj (libeay32.lib) referenced from '_X509V3_parse_list' in tmp32\v3_utl.obj (libeay32.lib) referenced from '_X509V3_parse_list' in tmp32\v3_utl.obj (libeay32.lib) referenced from '_X509V3_parse_list' in tmp32\v3_utl.obj (libeay32.lib) ... Link Error : Undefined symbol: '__declspec(dllimport) __errno (__imp___errno)' referenced from '_BIO_new_file' in tmp32\bss_file.obj (libeay32.lib) Link Error : Undefined symbol: '__aulldiv' referenced from '_BN_div' in tmp32\bn_div.obj (libeay32.lib) referenced from '_bn_div_words' in tmp32\bn_asm.obj (libeay32.lib) referenced from '_fmtint' in tmp32\b_print.obj (libeay32.lib) Link Error : Undefined symbol: '__aullrem' referenced from '_fmtint' in tmp32\b_print.obj (libeay32.lib) Link Error : Undefined symbol: '__allmul' referenced from '_bn_mul_add_words' in tmp32\bn_asm.obj (libeay32.lib) referenced from '_bn_mul_add_words' in tmp32\bn_asm.obj (libeay32.lib) referenced from '_bn_mul_add_words' in tmp32\bn_asm.obj (libeay32.lib) referenced from '_bn_mul_add_words' in tmp32\bn_asm.obj (libeay32.lib) referenced from '_bn_mul_add_words' in tmp32\bn_asm.obj (libeay32.lib) referenced from '_bn_mul_add_words' in tmp32\bn_asm.obj (libeay32.lib) referenced from '_bn_mul_add_words' in tmp32\bn_asm.obj (libeay32.lib) referenced from '_bn_mul_words' in tmp32\bn_asm.obj (libeay32.lib) ... -Link Errors End- What I understand of these errors is that linker could not find definitions of following variables/functions in the library: 1. _abort 2. __iob 3.
Re: libeay32.lib giving some link errors while using on Windows
Hi Qadeer, I just went through the exercise of building the openssl libraries for Win32 and for the Mac. I also built and installed libxml, libxslt, and xmlsec. This matters because xmlsec links against openssl. I discovered that the generated makefiles for Win32 hard code /MD into the compiler flags. This causes the link with your program to want the DLL runtime. (Note your error messages that mention dllimport.) I ran into all sorts of problems with the xmlsec link until I fixed this. I think that you can fix your problem if you edit ms\nt.mak after you run the configure. Find the line that begins with: CFLAG= /MD Change the /MD to something better, like /MT (multithreaded using LIBCMT.lib) or /ML (single threaded using LIBC.lib). Whatever you choose here must be the same as what you use for your program that links against this library. Now run the make and the install and try linking to your program. I hope this helps. - Rush __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: libeay32.lib giving some link errors while using on Windows
Great thanks Rush! This exercise did solve the problems :-) Now I see that this problem with nt.mak has already been pointed out by Matyas Majzik in one of his emails to this group. Thanks and regards, -- Qadeer Baig On 6/1/05, Rush Manbert [EMAIL PROTECTED] wrote: Hi Qadeer, I just went through the exercise of building the openssl libraries for Win32 and for the Mac. I also built and installed libxml, libxslt, and xmlsec. This matters because xmlsec links against openssl. I discovered that the generated makefiles for Win32 hard code /MD into the compiler flags. This causes the link with your program to want the DLL runtime. (Note your error messages that mention dllimport.) I ran into all sorts of problems with the xmlsec link until I fixed this. I think that you can fix your problem if you edit ms\nt.mak after you run the configure. Find the line that begins with: CFLAG= /MD Change the /MD to something better, like /MT (multithreaded using LIBCMT.lib) or /ML (single threaded using LIBC.lib). Whatever you choose here must be the same as what you use for your program that links against this library. Now run the make and the install and try linking to your program. I hope this helps. - Rush __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED] __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]