Quantcast

Mingw error comping openssl

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Mingw error comping openssl

mingw15
Hi,

I am trying to compile a simple program using openssl.

g++ -o prog.exe prog.cpp -lcrypto

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'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xeff): undefined reference to `CreateCompatibleDC@4'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf18): undefined reference to `GetDeviceCaps@8'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf33): undefined reference to `GetDeviceCaps@8'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf54): undefined reference to `CreateCompatibleBitmap@12'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf6b): undefined reference to `SelectObject@8'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf8e): undefined reference to `GetObjectA@12'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x1037): undefined reference to `BitBlt@36'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x104e): undefined reference to `GetBitmapBits@12'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x10c3): undefined reference to `SelectObject@8'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x10ce): undefined reference to `DeleteObject@4'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x10db): undefined reference to `DeleteDC@4'
gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x10e8): undefined reference to `DeleteDC@4'
collect2.exe: error: ld returned 1 exit status

How can I solve these errors?


Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mingw error comping openssl

niXman
> How can I solve these errors?

add the '-lgdi32'


--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows:
http://sourceforge.net/projects/mingwbuilds/

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mingw error comping openssl

Peter Rockett
In reply to this post by mingw15

On 15/11/12 15:28, mingw15 wrote:

> Hi,
>
> I am trying to compile a simple program using openssl.
>
> g++ -o prog.exe prog.cpp -lcrypto
>
> 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'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xeff):
> undefined reference to `CreateCompatibleDC@4'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf18):
> undefined reference to `GetDeviceCaps@8'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf33):
> undefined reference to `GetDeviceCaps@8'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf54):
> undefined reference to `CreateCompatibleBitmap@12'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf6b):
> undefined reference to `SelectObject@8'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0xf8e):
> undefined reference to `GetObjectA@12'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x1037):
> undefined reference to `BitBlt@36'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x104e):
> undefined reference to `GetBitmapBits@12'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x10c3):
> undefined reference to `SelectObject@8'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x10ce):
> undefined reference to `DeleteObject@4'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x10db):
> undefined reference to `DeleteDC@4'
> gcc/mingw32/4.7.2/../../..\libcrypto.a(rand_win.o):rand_win.c:(.text+0x10e8):
> undefined reference to `DeleteDC@4'
> collect2.exe: error: ld returned 1 exit status
>
> How can I solve these errors?
>
>
Explicitly link to gdi32?

P.


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mingw error comping openssl

Keith Marshall-3
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?

--
Regards,
Keith.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mingw error comping openssl

mingw15
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.
LRN
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mingw error comping openssl

LRN
-----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 :)

/me uses gnutls anyway...

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQpRxXAAoJEOs4Jb6SI2Cw9OMIANL32AERSnObRAlO5wl8nkJC
uv3/G+t3MA2HHFmZN0NMT5wNuOvmO6n4ZTytbR1zE9EWC6Qi8rqpw+Qn+2RV8zEp
xxJnWtsearRv4a8yalWQr0dtO+pwzjr22q51yPTAt9BgdlgPfitwGLoJ1nmpqv0b
bmYI3A5i94GZIAVtQV2xJkHmWODs294eZfo8V6k6lsCmP1ZgXi0lDE5sVVOoaCyE
/p2op6FuRE/UEuy+RuFTWc3gH3vUaoWSVPr5J2wZXxCJ2AAH5Pau4nfK6UYUiHqs
xZRoJ0ITHxF7yQmBq7ET2apu3UULvHhoMhLp/piYG2DNXy3Y32An/aJL/+bG2FM=
=4aSy
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mingw error comping openssl

Zouzou-2
In reply to this post by Keith Marshall-3
On 15/11/12 17:01, Keith Marshall wrote:

> 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?
>

I've seen this before as well; never gave it much thought. Looking at
that rand_win file
<http://cvs.openssl.org/rlog?f=openssl/crypto/rand/rand_win.c>, GDI
functions appear to be used to generate random data out of a screen capture.

Zouzou

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mingw error comping openssl

Fredric Johansson
In reply to this post by mingw15
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.

//Fredric

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Loading...