Link Errors building CGI on Win32

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

Link Errors building CGI on Win32

Andrew Willemsen

I have developed a CGI that uses OpenSSL and it is building fine using
0.9.7e.  Following the release of 0.9.8 I tried rebuilding with the new
release.  However, I am getting the following link errors:

libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__GetUserObjectInformationW@20
libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__GetProcessWindowStation@0
libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__GetDesktopWindow@0
libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__MessageBoxIndirectA@4

The above functions are in "user32.lib" which I do not want to link into my
application, as it is a CGI.  The MessageBoxIndirect function is called from
the Win32 version of the "OPENSSL_showfatal" function in
"crypto\cryptlib.c".  Obviously, a CGI should not be popping up a dialog
box, so is there any way I can use the non-Win32 version of the function?

Thanks for any help,

Andrew Willemsen

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Link Errors building CGI on Win32

Andy Polyakov
> I have developed a CGI that uses OpenSSL and it is building fine using
> 0.9.7e.  Following the release of 0.9.8 I tried rebuilding with the new
> release.  However, I am getting the following link errors:
>
> libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
> __imp__GetUserObjectInformationW@20
> libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
> __imp__GetProcessWindowStation@0
> libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
> __imp__GetDesktopWindow@0
> libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
> __imp__MessageBoxIndirectA@4
>
> The above functions are in "user32.lib" which I do not want to link into my
> application, as it is a CGI.  The MessageBoxIndirect function is called from
> the Win32 version of the "OPENSSL_showfatal" function in
> "crypto\cryptlib.c".  Obviously, a CGI should not be popping up a dialog
> box, so is there any way I can use the non-Win32 version of the function?

OPENSSL_showfatal is designed to detect in which context it's currently
executed, GUI, console app or service and act accordingly, namely pop-up
dialog, write to stderr or log a message to event log. So that if your
CGI program is spawned by a service, the message will be logged and no
dialog will pop-up. Dialog pops up only when you link it into pure GUI
application and don't setup std handlers. In other words, don't hesitate
to link with USER32. In addition, throw in even ADVAPI32 at once as it
will be required too. A.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]