5

I am trying to test the crypto library that comes with openssl, I downloaded openssl from http://www.openssl.org/source/ and it contains a /crypto folder with subfolders for each encryption type.

I wanted to try BIO_f_base64 so I created an empty console app, and added the includes needed, also added the paths to the /bio and /evp folders to c++ incl directories, and also added the main /openssl folder.

When I try to compile I get Cannot open include file: 'openssl/e_os2.h': No such file or directory

But the file is there, should I use the crypto lib in a different way? How can I use it adding only the /openssl path and not all the crypto subfolders I use?

Also I don't have any .lib files, where can I get them?

Mark Lakata
  • 19,989
  • 5
  • 106
  • 123
peterg
  • 137
  • 1
  • 1
  • 6
  • The downloaded OpenSSL library has all the headers, but they are stored as symlinks which Windows doesn't like (Cygwin can handle them). You'll want to use the prebuilt library below (see Joe's answer) – Mark Lakata Mar 13 '13 at 00:07
  • Also see [EVP Symmetric Encryption and Decryption | C++ Programs](https://wiki.openssl.org/index.php/EVP_Symmetric_Encryption_and_Decryption#C.2B.2B_Programs) for some tricks when working with C++. The same tricks were applied at [How to add 2 arbitrarily sized integers in C++?](https://stackoverflow.com/a/45940572/608639). – jww Dec 18 '17 at 05:09

2 Answers2

6

You need a version of the OpenSSL that is built for Windows, not the source release. I recommend installing a version from here, which has some nice installers for .lib files and headers. Once you have it installed you will have to update your VS project with the proper include paths to pick up the headers from where ever the installer put them.

Joseph Lisee
  • 3,439
  • 26
  • 21
1

In windows, if you want to compile it yourself, you can do so running:

For 64 bit:

perl Configure VC-WIN64A
ms\do_win64a.bat
nmake -k -f ms\ntdll.mak

For 32 bit:

perl Configure VC-WIN32
ms\do_nasm.bat
nmake -k -f ms\ntdll.mak

Once you compile the sources, the headers are located in the inc32 folder and the libs/dlls in the out32dll folder.

You can find much more detailed information in the INSTALL files.

eldruin
  • 332
  • 3
  • 16