The need for 'gdi32.lib'

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The need for 'gdi32.lib'

Gisle Vanem-4
Hello lists.

I've a question/doubt about this passage in
NOTES-Windows.txt:

  Linking your application
  ========================

  This section applies to all "native" builds.

  If you link with *static OpenSSL libraries* then you're expected to
  additionally link your application with WS2_32.LIB, *GDI32.LIB*,
  ADVAPI32.LIB, CRYPT32.LIB and USER32.LIB.

------
(* my emphasis)

Using OpenSSL in an all-static link of Wget, I always
note the line in 'wget.map':
Unused libraries:
   f:\ProgramFiler-x86\WindowsKits\Lib\10.0.19041.0\um\x86\gdi32.lib

Grepping through all of my OpenSSL sources, I see only the
above mention and one in 'Configurations\10-main.conf'.

So how/when is 'gdi32.dll' needed? Maybe it was true in the old-days?

--
--gv
Reply | Threaded
Open this post in threaded view
|

RE: The need for 'gdi32.lib'

Dr. Matthias St. Pierre
> Grepping through all of my OpenSSL sources, I see only the
> above mention and one in 'Configurations\10-main.conf'.
>
> So how/when is 'gdi32.dll' needed? Maybe it was true in the old-days?

My guess is that you are right and that it was needed only for the function readscreen(), used by RAND_screen() (see [1]).
A quick search shows that this function was removed in pull request #1079 (merged as commit 888db7f224fe) before
the release of 1.1.0, see [2].

Would you mind creating a pull request for changing the NOTES?

Matthias

[1] https://github.com/openssl/openssl/blob/OpenSSL_1_0_2-stable/crypto/rand/rand_win.c#L679-L745
[2] https://github.com/openssl/openssl/pull/1079