LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-13-2007, 02:42 PM   #1
ashishjen
LQ Newbie
 
Registered: Jan 2007
Posts: 25

Rep: Reputation: 15
problem with openssl


i m getting the following error when compiling any file using SSL libraries...

[root@localhost ssl]# gcc -I./include nossl.c ./lib/libcrypto.a
nossl.c: In function ‘main’:
nossl.c:25: warning: ‘return’ with no value, in function returning non-void
nossl.c:31: warning: ‘return’ with no value, in function returning non-void
/tmp/ccgusGub.o: In function `main':nossl.c.text+0x22): undefined reference to `SSL_load_error_strings'
./lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':dso_dlfcn.c.text+0x27d): undefined reference to `dlsym'
:dso_dlfcn.c.text+0x2f9): undefined reference to `dlerror'
./lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':dso_dlfcn.c.text+0x36d): undefined reference to `dlsym'
:dso_dlfcn.c.text+0x3e1): undefined reference to `dlerror'
./lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':dso_dlfcn.c.text+0x44c): undefined reference to `dlclose'
./lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':dso_dlfcn.c.text+0x4f5): undefined reference to `dlopen'
:dso_dlfcn.c.text+0x546): undefined reference to `dlclose'
:dso_dlfcn.c.text+0x56f): undefined reference to `dlerror'
collect2: ld returned 1 exit status
[root@localhost ssl]#

try to sort out this....
 
Old 01-13-2007, 04:36 PM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Quote:
nossl.c:25: warning: ‘return’ with no value, in function returning non-void
nossl.c:31: warning: ‘return’ with no value, in function returning non-void
I'm pretty sure in C, if a function is cast as void, you don't have to enter a RETURN call at the end of the function. But it looks like the function casting isn't void, but something non-void (such as int, char, double, etc.). Check to make sure if you use a return in a function, and the return type isn't void, that you specify the returned value.
 
Old 01-14-2007, 07:27 PM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Warnings about proper C usage aside, you need to tell the linker to include the SSl library, where SSL_load_error_strings is defined. You do this by adding
Code:
-lssl
...to your linker command.
You need to make sure the libssl.a file is in the default linker path. Usually this woulc be /usr/lib/libssl.a. If that exists, you're OK, else you'll have to add a -L option. E.g. if your libssl.a file is in the /home/me/build/ssl/lib directory, you would add
Code:
-L/home/me/build/ssl/lib -lssl
Similarly for other missing symbols.
 
Old 01-15-2007, 11:00 PM   #4
ashishjen
LQ Newbie
 
Registered: Jan 2007
Posts: 25

Original Poster
Rep: Reputation: 15
@matthewg42

thanx ... its working now....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
openssl problem James_dean Programming 0 09-22-2005 05:10 AM
Problem with OpenSSL and sockets alitrix Programming 3 07-08-2005 12:45 PM
openssl problem abdullahgee Programming 0 06-03-2004 02:00 PM
epic + openssl problem ratty007 Linux - Newbie 2 02-24-2004 04:05 PM
openSSL problem raven Linux - Software 2 09-15-2002 11:24 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration