PLEASE HELP - How do I include OpenSSL in my code?
- From: "cpptutor2000@xxxxxxxxx" <cpptutor2000@xxxxxxxxx>
- Date: 12 May 2006 14:20:04 -0700
Could some C guru please help me? I have a simple piece of code as:
#include <stdio.h>
#include <stdlib.h>
#include <openssl/rand.h>
int main(){
unsigned char temp[4];
RAND_bytes(temp, 4);
return 0;
}
If I type: whereis openssl
I get: openssl: /usr/bin/openssl /usr/include/openssl
/usr/share/man/man1/openssl.1ssl.gz
I compile this as:
gcc -g -o test test.c -I/usr/include/openssl -L/usr/bin/openssl
I get a linker error message as :
/tmp/cc4tQEqd.o(.text+0x1af0): In function `main':
/home/ecelrc/students/abanerj/cpp/test.c:6: undefined reference to
`RAND_bytes'
Could someone please point out what I am doing wrong? Any help would be
greatly
appreciated.
.
- Follow-Ups:
- Re: PLEASE HELP - How do I include OpenSSL in my code?
- From: Ben C
- Re: PLEASE HELP - How do I include OpenSSL in my code?
- From: Martin Ambuhl
- Re: PLEASE HELP - How do I include OpenSSL in my code?
- From: Richard Heathfield
- Re: PLEASE HELP - How do I include OpenSSL in my code?
- Prev by Date: Re: 64 bit Endianness issue
- Next by Date: Re: Bitwise AND etc
- Previous by thread: Dynamic tracing of C code execution
- Next by thread: Re: PLEASE HELP - How do I include OpenSSL in my code?
- Index(es):
Relevant Pages
|