user391318 user391318 - 1 year ago 149
Linux Question

Undefined Reference Shared Object Linux [c++]

I have created a shared object named as and it worked perfectly with an executable developed in c/c++ (linux). This shared object provides some functions for integration in external software. Below are some characteristics of this shared object:

  • Communicates with devices on RS232

  • TCP/IP + SSL communication with a server

Now I am creating JNI wrapper ( of above shared object and used this command to open shared object and create a handler:


But it gives me error Unable to Load LIB : /usr/lib/ - [/usr/lib/ undefined symbol: EVP_cleanup]

EVP_cleanup is used in and is part of openssl/evp.h header file.

I tried to link ssl and crypto libs in as well but output is same as above.

Can someone give me suggestions or an alternate method?



Answer Source

It appears that you have linked your code only with

You must also explicitly link with EVP_cleanup() is defined in

objdump is a useful tool for figuring out what you need to link with, when documentation is lacking.

$ objdump -T /usr/lib64/ | grep EVP_cleanup
000000000012f5e0 g    DF .text  0000000000000054 EVP_cleanup
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download