2

I am using the ACE library to do some reactor jobs. On linux ,the default ACE compile output is the libACE.so. I usually to compilte it with the -lACE compile option, but this rely on whether i have configured the libACE.conf in ld.so.conf.d directory. If I want to sub class ACE_Task,which could be imported from ACE.so , the compile rely on the libACE.so, if I want to dynamic load the ACE.so , how can i do this? I have tried, if i use dlopen , then the link error occurs. so ,is there any way to load ACE.so dynamically and still can implement the ACE_Task like this?

class test: public ACE_Task<ACE_MT_SYNCH> { } 
2
  • So do you have the library configured with ld.so.conf? Commented Dec 7, 2012 at 9:42
  • I have configured it with the ld.so.conf,this is fine with compile,but when i want to release all the files on another PC, i have to configure the ld.so.conf, Is there any way to sub-classing a class which is the from .so file and i can still load it at run time? Commented Dec 7, 2012 at 11:58

1 Answer 1

1

Sub-classing happens mostly at compilation time. You need to have the super-class[es] appropriately defined in some header file[s].

At runtime, what matters is the availability of vtables and inherited member functions (and perhaps RTTI).

You probably want to link the libACE.so to your shared object (the dlopen-ed thing you are building). This is possible with eg g++ -rdynamic -shared your*.pic.o -lACE -o yoursharedobject.so

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.