0

In Ubuntu 14.04 I have:

Makefile:

CC = g++

all: imapcl 

imapcl: imapcl.o
    $(CC) -o imapcl imapcl.o

clean:
    rm -rf *o imapcl.o imapcl.exe imapcl 

and this simple test file imapcl.cpp

// OpenSSL headers
#include "openssl/bio.h"
#include "openssl/ssl.h"
#include "openssl/err.h"

int main ()
{    
    /* Initializing OpenSSL */       
    SSL_load_error_strings();
    ERR_load_BIO_strings();
    OpenSSL_add_all_algorithms();
}

When compiling I get this error:

imapcl.cpp:(.text+0x2607): undefined reference to `SSL_load_error_strings'
imapcl.cpp:(.text+0x260c): undefined reference to `ERR_load_BIO_strings'
imapcl.cpp:(.text+0x2611): undefined reference to `OPENSSL_add_all_algorithms_noconf'
collect2: error: ld returned 1 exit status
J. Doe
  • 1
  • You should find an answer [here](http://stackoverflow.com/questions/12573816) – karastojko Nov 19 '16 at 12:14
  • To be clear, you want [Andy's answer](http://stackoverflow.com/a/18872992/608639): `gcc -Wall -g -o program program.o -lssl -lcrypto`. You ned to add the two libraries with `-lssl -lcrypto` (in that order). – jww Nov 19 '16 at 12:14

0 Answers0