0

I am trying to include

#include <openssl/evp.h>

to my C program.

I have downloaded openssl from their site and extracted folder

  -openssl
    - evp.h

however using compilation command

g++ -Wall -pedantic program.c -lopenssl/evp

threw same error

fatal error: evp.h: No such file or directory
 #include <openssl/evp.h>

I have tried to just include #include

and copy evp.h directly to the folder with my program.c and compile it using

g++ -Wall -pedantic program.c -evp

yet it still throws same error. What is the right way to include this kind of library into my C program?

Thanks!.

Darlyn
  • 4,715
  • 12
  • 40
  • 90
  • Take a look at [How to include header files in GCC search path?](http://stackoverflow.com/q/973146/608639) and [Linking OpenSSL libraries to a program](http://stackoverflow.com/q/4352573/608639). [How do C/C++ compilers work?](http://stackoverflow.com/q/1085490/608639) and [How do I install the OpenSSL libraries on Ubuntu?](http://stackoverflow.com/q/3016956/608639) may be useful as well. – jww Mar 25 '17 at 19:57

1 Answers1

0

You write that you downloaded opensll, but not that you compiled and nstalled it. If you didn't the header file you try to include is not in a place where the compiler would look for it. And even if you somehow manage to include the header file (e.g. by copying it to a place where the compiler finds it or modifying its search path) the next step in building your program, linking it, will rather likely fail if the library itself isn't anywhere to be found (the header file just contains a description of the libraries interface and isn't the library!).