简体   繁体   中英

Shared Library undefined symbol

Similar title question exist but not the same problem . I have two machines one with CentOS 7.3.1611 and one with similar to CentOS you can say custom RedHat .
i have a SDK that i need to run on the custom machine but it doesn't have yum gcc .
so i had to compile and install the SDK on CentOS, after that i copied the result to the custom machine (shared libraries, scripts , binaries ...) in Order to run them there .
Naturally the SDK worked fine on CentOS, but on the custom machine while loading some of the drivers and other libraries fine , i got an error when loading a specific library as follow :

dlopen (libsdkpolicerlib.so) failed: (/usr/local/bin/../lib/libsdkpolicer.so.1: undefined symbol: policer_validate_packet_type)

Notice there are three shared objects involved here :

  • libsdkpolicerlib.so the one that dlopen tries to open
  • libsdkpolicer.so.1
  • libpolicercomlib.so that contains the symbol policer_validate_packet_type

all of the shared object are in the same directory /usr/local/lib .
libpolicercomlib.so actually contains the symbol .

I have :

  • verified the ld.so.cache contains all of the above libraries .
  • Also i have added /usr/local/lib to the LD_LIBRARY_PATH variable .
  • Executed ldconfig with "-n" with the path ...

I know this isn't the best way to do this sort of stuff, but this solution is temporary .

My question is what else do i have to verify in order for this to work ?
What am i missing here ?

You can check /lib/libsdkpolicer.so.1 with ldd command, maybe the libpolicercomlib.so file which you copy just is a link file, and check it on your machine without yum GCC. If everything is correct, you can copy the /lib64/ld-linux-x86-64.so.2 loader from your complie machine to your new machine(backup it before) and try it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM