Thanks, Gregory, for your reply. But it doesn't really explain the situation.
The problem is that the ADVAPI32.LIB import library is included in both libeay.lib and ssleay.lib. Since the imported symbols are the same in both libs, I don't see any problem with it. But, when I build a library and try to include both OpenSSL libs in it, I get the warning. I get the warning only when creating a static library that includes both ssleay.lib and libeay.lib as input. >From the MSDN about this warning (LNK4006): --------------------------------------------------- " symbol already defined in object; second definition ignored The given symbol, displayed in its decorated form, was multiply defined. When this warning is encountered, symbol will be added twice, but only its first form will be used. Tips ---- * The given symbol may be a packaged function, created by compiling with /Gy. This symbol was included in more than one file but was changed between compilations. Recompile all files that include the symbol. * The given symbol may have been defined differently in two member objects in different libraries. * An absolute may have been defined twice, with a different value in each definition. * If the error message is received when combining libraries, symbol already exists in the library being added to. " ---------------------------------------------------- If I understand correctly, mine is the 4th case (combining libraries). This is the only case where the duplicate symbol doesn't have different definitions in the input libs. So I guess the warning may be ignored. I'm looking for the reason ADVAPI32.LIB is included in the OpenSSL libs. I also fail to understand how come the old libraries (0.9.6a) that I have do not include symbols from ADVAPI32.LIB while the makefile seems the same. -----Original Message----- From: Gregory Stark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 1:10 AM To: [EMAIL PROTECTED] Subject: Re: 0.9.6g win2k linkage warning: duplicate advapi32 symbols You can't statically link to the functions in the advapi32; they are only available in dll form. The advapi32.lib is only an import library. It does not contain the actual code for the functions, just enough information to tell the compiler how to set up the run-time linking with the dll. I don't know what the error means, however. ====================== Greg Stark [EMAIL PROTECTED] ====================== ----- Original Message ----- From: "Tal Mozes" <[EMAIL PROTECTED]> To: "Openssl-Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, August 26, 2002 8:44 AM Subject: 0.9.6g win2k linkage warning: duplicate advapi32 symbols > Hi, > > I statically link with both libcrypto and libssl, and I got this strange > linker warning that I haven't gotten before: > > ssleay32.lib(ADVAPI32.dll) : warning LNK4006: __imp__WriteRaw@12 already > defined in libeay32.lib(ADVAPI32.dll); second definition ignored > > Looking at the libs (and in the makefiles) it's obvious that both contain > advapi32.lib. So it seems logical that I should get this warning. > > Two questions remain: > 1. How come I've never gotten this warning with version 0.9.6a ? I don't see > any relevant change in the makefile. > > 2. Why include advapi32.lib in the static libs anyways? If I understand > correctly, both openssl libs use dynamic linkage (in crypto\bio\bss_log.c > and in crypto\rand\rand_win.c) and obtain function pointers to advapi32.dll. > > Tal Mozes > Security & Research Team Leader > Cyber-Ark Software Ltd. > +972-8-920 7776 (ext. 224) > www.cyber-ark.com > > > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List [EMAIL PROTECTED] > Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]