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 ???

4
  • What error exactly? Is lib_9_3.so something you built and can modify? Commented Aug 1, 2018 at 12:29
  • 2
    dlopen() doesn't return a (pointer to a) function, so this code looks fishy... Commented Aug 1, 2018 at 12:30
  • @JohnZwinck , Yea Its something I built and I can modify. Commented Aug 1, 2018 at 12:51
  • I suggest you build your lib_9_3.so with -Wl,--no-undefined to prevent it building with unsatisfied dependencies. See stackoverflow.com/questions/2356168/… Commented Aug 1, 2018 at 13:51

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.