How to compile .c file with OpenSSL includes?
Use the -I
flag to gcc properly.
gcc -I/path/to/openssl/ -o Opentest -lcrypto Opentest.c
The -I
should point to the directory containing the openssl
folder.
Your include paths indicate that you should be compiling against the system's OpenSSL installation. You shouldn't have the .h
files in your package directory - it should be picking them up from /usr/include/openssl
.
The plain OpenSSL package (libssl
) doesn't include the .h
files - you need to install the development package as well. This is named libssl-dev
on Debian, Ubuntu and similar distributions, and libssl-devel
on CentOS, Fedora, Red Hat and similar.