Hi All,
I am having main program which has one base class that needs to be used by shared library.
Base class has some pure virtual method that derived class in shared library needs to be over written.
Main program load shared library using dlopen system call.
dlopen("shared file name", RTLD_NOW|RTLD_GLOBAL);
Base class
class RateComputer
{
public:
RateComputer();
virtual ~RateComputer();
virtual void OnMarketData() = 0;
virtual void OnConfigFileUpdate() = 0;
private:
};
Derived class in shared library.
class WeightedRateComputer : public RateComputer
{
public:
WeightedRateComputer();
~WeightedRateComputer();
void OnMarketData();
void OnConfigFileUpdate();
private:
};
While compilation of binary and so file I have added -rdynamic flag. But during loading of library it gives error "undefined symbol: _ZTI12RateComputer".
When i run nm command as "nm binary-name | grep RateComputer" I have got below output
00000000004435a0 t _ZNKSt10_HashtableIsSt4pairIKsSt6vectorIP12RateComputerSaIS4_EEESaIS7_ENSt8__detail10_Select1stESt8equal_toIsESt4hashIsENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS 9_20_Prime_rehash_policyENS9_17_Hashtable_traitsILb0ELb0ELb1EEEE19_M_find_before_nodeEmRS1_m.isra.159
0000000000443f40 W _ZNSt10_HashtableISsSt4pairIKSsP12RateComputerESaIS4_ENSt8__detail10_Select1stESt8equal_toISsESt4hashISsENS6_18_Mod_range_hashingENS6_20_Default_ranged_hashENS6_20_Prime_reha sh_policyENS6_17_Hashtable_traitsILb1ELb0ELb1EEEE10_M_emplaceIIS0_ISsS3_EEEES0_INS6_14_Node_iteratorIS4_Lb0ELb1EEEbESt17integral_constantIbLb1EEDpOT_
0000000000443f40 W _ZNSt10_HashtableISsSt4pairIKSsP12RateComputerESaIS4_ENSt8__detail10_Select1stESt8equal_toISsESt4hashISsENS6_18_Mod_range_hashingENS6_20_Default_ranged_hashENS6_20_Prime_reha sh_policyENS6_17_Hashtable_traitsILb1ELb0ELb1EEEE10_M_emplaceIJS0_ISsS3_EEEES0_INS6_14_Node_iteratorIS4_Lb0ELb1EEEbESt17integral_constantIbLb1EEDpOT_
0000000000443d30 W _ZNSt10_HashtableISsSt4pairIKSsP12RateComputerESaIS4_ENSt8__detail10_Select1stESt8equal_toISsESt4hashISsENS6_18_Mod_range_hashingENS6_20_Default_ranged_hashENS6_20_Prime_reha sh_policyENS6_17_Hashtable_traitsILb1ELb0ELb1EEEE21_M_insert_unique_nodeEmmPNS6_10_Hash_nodeIS4_Lb1EEE
00000000004442c0 W _ZNSt10_HashtableIsSt4pairIKsSt6vectorIP12RateComputerSaIS4_EEESaIS7_ENSt8__detail10_Select1stESt8equal_toIsESt4hashIsENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS9 _20_Prime_rehash_policyENS9_17_Hashtable_traitsILb0ELb0ELb1EEEE10_M_emplaceIIS0_IsS6_EEEES0_INS9_14_Node_iteratorIS7_Lb0ELb0EEEbESt17integral_constantIbLb1EEDpOT_
00000000004442c0 W _ZNSt10_HashtableIsSt4pairIKsSt6vectorIP12RateComputerSaIS4_EEESaIS7_ENSt8__detail10_Select1stESt8equal_toIsESt4hashIsENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS9 _20_Prime_rehash_policyENS9_17_Hashtable_traitsILb0ELb0ELb1EEEE10_M_emplaceIJS0_IsS6_EEEES0_INS9_14_Node_iteratorIS7_Lb0ELb0EEEbESt17integral_constantIbLb1EEDpOT_
00000000004440d0 W _ZNSt10_HashtableIsSt4pairIKsSt6vectorIP12RateComputerSaIS4_EEESaIS7_ENSt8__detail10_Select1stESt8equal_toIsESt4hashIsENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS9 _20_Prime_rehash_policyENS9_17_Hashtable_traitsILb0ELb0ELb1EEEE21_M_insert_unique_nodeEmmPNS9_10_Hash_nodeIS7_Lb0EEE
0000000000438ce0 W _ZNSt10_HashtableIsSt4pairIKsSt6vectorIP12RateComputerSaIS4_EEESaIS7_ENSt8__detail10_Select1stESt8equal_toIsESt4hashIsENS9_18_Mod_range_hashingENS9_20_Default_ranged_hashENS9 _20_Prime_rehash_policyENS9_17_Hashtable_traitsILb0ELb0ELb1EEEE5clearEv
0000000000443c30 W _ZNSt6vectorIP12RateComputerSaIS1_EE19_M_emplace_back_auxIIRKS1_EEEvDpOT_
0000000000443c30 W _ZNSt6vectorIP12RateComputerSaIS1_EE19_M_emplace_back_auxIJRKS1_EEEvDpOT_
But if i grep symbol which so file is searching for "_ZTI12RateComputer" I didnt get any thing.
nm rate_engine | grep _ZTI12RateComputer
does i am missing any steps?
Thank you in advance for your help.