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:
>> undefined reference to `CreateDCA@...'
>> ]...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?