How to use openssl crypto lib headers in c ++?

I'm trying to check the crypto library that comes with openssl, I downloaded openssl from http://www.openssl.org/source/ and contains the / crypto folder with subfolders for each type of encryption.

I wanted to try BIO_f_base64, so I created an empty console program and added the necessary additions, added paths to the / bio and / evp folders in C ++, including directories, and also added the main / openssl folder.

When I try to compile, I get I can’t open the include file: 'openssl / e_os2.h': There is no such file or directory

But there is a file, should I use the crypto library differently? How can I use it by adding only the / openssl path and not all the crypto subdirectories that I use?

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

+4
source share
2 answers

You need the version of OpenSSL created for Windows, not the original version. I recommend installing the version here , which has some good installers for .lib files and headers. Once you have installed it, you will have to update your VS project using the correct paths included to pick up the headers from where the installer installed them.

+5
source

On Windows, if you want to compile it yourself, you can do this:

For 64 bits:

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

For 32 bits:

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

After compiling the sources, the headers are located in the inc32 folder and libs/dlls in the out32dll folder.

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

+1
source

Source: https://habr.com/ru/post/1310754/


All Articles