OpenSSL

thesadguy

Active Member
Joined
Nov 29, 2008
Messages
70
Reaction score
0
Hi all

I have installed libssl0.9.8 and libssl-dev packages on Ubuntu Intrepid.

I have the following code:

Code:
#include "openssl/bio.h"
#include "openssl/ssl.h"
#include "openssl/err.h"

int main()
{
	BIO* bio;
	
	bio = BIO_new_connect("google.com");
	
	return 0;
}

That compiles, but does not link. What should I be linking with? Right now, I do
Code:
gcc -c test.c -o test.o

Which goes through without error, but

Code:
gcc test.o -o test

throws me
Code:
 undefined reference to `BIO_new_connect'
any ideas?
 
Hi all

I have installed libssl0.9.8 and libssl-dev packages on Ubuntu Intrepid.

I have the following code:

Code:
#include "openssl/bio.h"
#include "openssl/ssl.h"
#include "openssl/err.h"

int main()
{
	BIO* bio;
	
	bio = BIO_new_connect("google.com");
	
	return 0;
}

That compiles, but does not link. What should I be linking with? Right now, I do
Code:
gcc -c test.c -o test.o

Which goes through without error, but

Code:
gcc test.o -o test

throws me
Code:
 undefined reference to `BIO_new_connect'
any ideas?

Try
Code:
gcc -c test.c -o test.o
gcc -lssl test.o -o test
 
Top
Sign up to the MyBroadband newsletter
X