I'd have thought it would be better to link this *implicitly*, by
specifying the -mwindows option, (so correctly declaring the intent to
create a windowed application). However, I'd also be inclined to pose
a second question: why does your implementation of an openssl library,
(which is supposedly platform agnostic), include explicit references
to platform-specific MS-Windows GDI functions in the first place?

Re: Mingw error comping openssl

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15.11.2012 20:29, mingw15 wrote:
> Those are very good questions. I have the same.
>
> I got the source from openssl.org and compiled it, like I compile
> tons of stuff.
>
> But as to why I need gdi32 I have no clue. I am not compiling a gui
> or something. Just a console program.
>
My guess is that these W32 API functions are somehow used for entropy
gathering. Though looking at the source should reveal their exact
purpose, so guessing is not a good strategy :)

Re: Mingw error comping openssl

> On 15 November 2012 15:42, Peter Rockett wrote:
>> On 15/11/12 15:28, mingw15 wrote:
>>> I am trying to compile a simple program using openssl.
>>>
>>> g++ -o prog.exe prog.cpp -lcrypto
>
> The first question I'd be inclined to ask: from whence did you source
> libcrypto.a? AFAIK, we do not provide any such library for use with
> the MinGW compiler suite.
>
>>> And it generates these errors:
>>>
>>> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xef0):
>>> undefined reference to `CreateDCA@16'
>>>
>>> ]...more undefined MS-Windows GDI reference errors snipped...]
>>>
>>> How can I solve these errors?
>>>
>> Explicitly link to gdi32?
>
> I'd have thought it would be better to link this *implicitly*, by
> specifying the -mwindows option, (so correctly declaring the intent to
> create a windowed application). However, I'd also be inclined to pose
> a second question: why does your implementation of an openssl library,
> (which is supposedly platform agnostic), include explicit references
> to platform-specific MS-Windows GDI functions in the first place?
>

Re: Mingw error comping openssl

On Thu, Nov 15, 2012 at 5:29 PM, mingw15 <[hidden email]> wrote:
> Those are very good questions. I have the same.
>
> I got the source from openssl.org and compiled it, like I compile tons of
> stuff.
>
> But as to why I need gdi32 I have no clue. I am not compiling a gui or
> something. Just a console program.
>

The requirement is mentioned in the windows specific readme in the
openssl sources. As for the reason I guess the other answers in this
thread explains it.