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.... |
Quote:
|
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 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 |
@matthewg42
thanx ... its working now....
|
All times are GMT -5. The time now is 01:57 PM. |