0

I dont know if this is a bad question, but I am having some problem of an undefined symbol when my program is run.

I have more than 20 dynamic libraries,

When I run my program that loads my library

 void *encode_func  = dlopen("lib_9_3.so", RTLD_LAZY  );

It returns error as undefined symbol,

All its symbol depends upon those 20 dynamic libraries Can I load all those dynamic libraries in my C program ???

EDIT::

if ( encode_func == NULL)
    {
            fprintf(stderr, "dlopen failed: %s\n", dlerror());
            return 1;
    }

Code is fine, dlerror is returning

 dlopen failed: ./lib_9_3.so: undefined symbol: sip_getExtensionParamCountFromFromHdr

These symbols are present in my 20 dynamic libraries, I found this out by doing "nm"

One more thing, these undefined symbols are not system specific.

Can I load all those dynamic libraries in my C program ???

Mayank Kataruka
  • 395
  • 1
  • 2
  • 11
  • What error exactly? Is `lib_9_3.so` something you built and can modify? – John Zwinck Aug 01 '18 at 12:29
  • 2
    `dlopen()` doesn't return a (pointer to a) function, so this code looks fishy... –  Aug 01 '18 at 12:30
  • @JohnZwinck , Yea Its something I built and I can modify. – Mayank Kataruka Aug 01 '18 at 12:51
  • I suggest you build your `lib_9_3.so` with `-Wl,--no-undefined` to prevent it building with unsatisfied dependencies. See https://stackoverflow.com/questions/2356168/force-gcc-to-notify-about-undefined-references-in-shared-libraries – John Zwinck Aug 01 '18 at 13:51

0 Answers0