How to compile .c file with OpenSSL includes?
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 openssl-devel
on CentOS, Fedora, Red Hat and similar.
How to use OpenSSL exacly?
It looks like that your OpenSSL is compiled with no-md5
option. So, download OpenSSL and build it with md5 if required.
Linking OpenSSL libraries to a program
Silly "Linux-isms" strike again! Apparently, I need to change my command such that the -L
and -l
stuff is at the end like (despite what man gcc
seems to indicate):
gcc -Wall -Wextra -Werror -static -o myApp source1.o source2.o common.o -Lopenssl/openssl-0.9.8k/ -lssl -lcrypto -Iopenssl/openssl-0.9.8k/include
How to compile a simple program with OpenSSL?
In some code versions of openssl book, the thread related functions are stored in reentrant.c, (in fact the declaration of TRHEAD_setup, in the version i've seen is there), so try with:
gcc -Wall common.c client.c reentrant.c -o client -lcrypto -lssl
How to compile openssl with afl-gcc
I was making a simple mistake of calling ./configure after manually making changes to Makefile. Each ./configure command overwrites previous Makefile. So my step should be in following order.
./config no-shared no-idea no-mdc2 no-rc5 no-comp enable-tlsext no-ssl2
make depend
Manually replace every occurrence of `gcc`to `afl-gcc` in Makefile
make && make install
Thanks.
Related Topics
Operator Overloading Outside Class
C++ Access Derived Class Member from Base Class Pointer
Compiling External C++ Library for Use with iOS Project
How Does Openmp Handle Nested Loops
What Is the Fastest Way to Change a Key of an Element Inside Std::Map
Using Bitwise Operators for Booleans in C++
Why Does Visual Studio 2013 Error on C4996
Skipping Incompatible Libraries at Compile
Best Method for Storing This Pointer for Use in Wndproc
How to Generate Assembly Code with Clang in Intel Syntax
Converting Data from Glreadpixels() to Opencv::Mat
Segmentation Fault at Glgenvertexarrays( 1, &Vao );
How to Convert Unsigned Char* to Std::String in C++
Why Is It Not Possible to Overload Class Templates
Are There Stackless or Heapless Implementation of C++