OpenSSL projects in VC2008

T

Tan

Hi folk,

I'm trying to install latest OpenSSL version in VS2008 Express Edition
on WinXP. I have downloaded and installed the redistributable for VC+
+2008 (including SP1), and also installed the latest version of pre-compiled
version of OpenSSL from /www.shininglightpro.com/products/
Win32OpenSSL.html website. So AFAIK there is no need for Perl script
compilation and NASM, MASM issue as long as I have the pre-compiled
binaries. If I'm mistaken please correct me? I'm sure that I have set
VC++2008
search directory/path and Additional dependency directory
properly(ssleay32MT.lib, libeay32MD.lib, etc..). But when i run the code,
even with the simple code as that


#include "stdafx.h"
#include "stdlib.h"
#include "winsock.h"
//OPENSSL INCLUSION HEADERS
#include "openssl/ssl.h"
#include <openssl/ssl3.h>
#include <openssl/x509.h>
#include <openssl/err.h>
#include <openssl/crypto.h>


int _tmain(int argc, _TCHAR* argv[])
{
printf("New console application has been created\n");



}


I get many linker errors, it seems at the start of the line,
libeay32MT.lib is loaded but probelm with bss_sock.obj, cryptlib exist.
Those
errors and fuctions seems like Win native functions (such as
GetDesktopWindow, MessageBoxA etc) don't think they are related with
OpenSSL..

1>libeay32MT.lib(bss_sock.obj) : error LNK2001: unresolved external symbol
_closesocket@4
1>libeay32MT.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
mp__GetUserObjectInformationW@20
1>libeay32MT.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
_imp__GetProcessWindowStation@0
1>libeay32MT.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__GetDesktopWindow@0
1>libeay32MT.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__MessageBoxA@16
1>libeay32MT.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__DeregisterEventSource@4
1>libeay32MT.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__ReportEventA@36
1>libeay32MT.lib(cryptlib.obj) : error LNK2001: unresolved external symbol
__imp__RegisterEventSourceA@8
..

Probably something is still not completed (or not implemented) with VC2008
causing these errors.

Any help will be appreciated.
Best Regards,
 
G

Giovanni Dicanio

I get many linker errors, it seems at the start of the line,
libeay32MT.lib is loaded but probelm with bss_sock.obj, cryptlib exist.
Those
errors and fuctions seems like Win native functions (such as
GetDesktopWindow, MessageBoxA etc) don't think they are related with
OpenSSL..

Functions like GetDesktopWindow() are defined in User32.dll, and you should
link with user32.lib.

I don't know about VC++ 2008 Express, but this is done automatically with
commercial VS2008 editions, like VS2008 Professional.

Giovanni
 
T

Tan

I agree, it made me think that something is malfunctioning in VC2008 EE due
to the fact it's a beta version. I'll play around a bit more to make sure
that probelm is VC2008 EE related.

One more thing to clarify, at Project Settings->Linker
tab->Input ->Additional Dependecy in "inherited values" i can't see the
user32.lib, gdi32.lib, kernel32.lib etc.. as well. So I made the linking
manually( still not sure that /LIBPATH: precedence should be used or not
before the library name) but this time the lib's reside in <C:\Program
Files\Microsoft SDKs\Windows\v6.0A\Lib> rather than <C:\Program
Files\Microsoft Visual Studio 9.0\VC\lib> location. Do you think that's
normal ?

thnx in advance,
 
G

Giovanni Dicanio

it made me think that something is malfunctioning in VC2008 EE due to the
fact it's a beta version.

VS2008 EE is no more in beta... instead, you can already download the SP1
(which I would suggest you to do).
I'll play around a bit more to make sure that probelm is VC2008 EE
related.

I would suggest you to try to create a trivial Win32 applications and see
what happens...
Then, if that builds fine, you can add OpenSL files.
lib's reside in <C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib> rather
than <C:\Program Files\Microsoft Visual Studio 9.0\VC\lib> location. Do
you think that's normal ?

I think the Win32 Platform SDK is installed in a different sub-tree than
VS2008 EE, so I think that your path should be OK...

Giovanni
 
T

Tan

I suppose the problem is solved, still dubious cause didn't check the full
functioning but one way or the other eliminated the library or dll(of course
with adding the #pragma comment(lib, "ws2_32.lib") ) linking, from now it
can't be a big deal I think. Actually required libraries for OpenSSL were
slightly in the different folder :)

thnx in advance,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top