Hi I found the mistake. In case someone has a similar error:
I had -fvisibility=hidden -fvisibility-inlines-hidden as flags to the compiler. The tracker used these. However if you use them together with a nox component, get_factory() will not be accesible. So, I just removed these. Sander 2012/4/19 Sander Vrijders <[email protected]> > and the output of readelf -s discovery.so | grep fac: > 123: 00082a30 8 OBJECT LOCAL DEFAULT 26 _ZGVZ11get_factoryE1i > 124: 00082a38 8 OBJECT LOCAL DEFAULT 26 _ZGVZ11get_factoryE1f > 125: 00082a40 8 OBJECT LOCAL DEFAULT 26 _ZZ11get_factoryE1f > 126: 00082a48 4 OBJECT LOCAL DEFAULT 26 _ZZ11get_factoryE1i > 302: 000424c0 321 FUNC LOCAL HIDDEN 12 get_factory > 391: 0006fac0 186 OBJECT LOCAL HIDDEN 14 _ZTSSt10_HashtableISsSt4p > > > > 2012/4/19 Sander Vrijders <[email protected]> > >> The old code has not been changed, it has been build from scratch. >> The compiler/linker warnings I got were all deprecated warnings for >> auto_ptr >> (because the tracker uses c++0x code. I have to supply the --std=c++0x >> flag) >> The new meta.json: >> >> { >> "components": [ >> { >> "name": "discovery" , >> "library": "discovery" , >> "dependencies": [ >> "link event" >> ] >> }, >> { >> "name": "link event" , >> "library": "link_event" >> } >> ] >> } >> >> The output from nm -D discovery.so | grep factory: >> >> U _ZN5vigil9container17Component_factoryC2Ev >> U _ZN5vigil9container17Component_factoryD2Ev >> U _ZTIN5vigil9container17Component_factoryE >> >> Thanks in advance! >> >> >> 2012/4/19 Murphy McCauley <[email protected]> >> >>> I can't guess without knowing more about what has been changed in the >>> code and meta file, so I'm grasping at straws here. >>> >>> One thing I might suggest is rebuilding your component and looking for >>> compile/link warnings. Or dump the shared object and see if there's an >>> exported symbol for the factory function (maybe it has the wrong name >>> somehow?). >>> >>> -- Murphy >>> >>> On Apr 19, 2012, at 4:29 AM, Sander Vrijders wrote: >>> >>> The default discovery application is no longer present in the directory. >>> I actually am a master student and am developing this for my thesis. >>> The new discovery application (written in C++) was supplied to me by my >>> thesis supervisor. >>> If I would run this application standalone it would work, yet when I >>> integrate it with the tracker, it doesn't anymore. >>> >>> Kind regards >>> Sander >>> >>> 2012/4/19 Murphy McCauley <[email protected]> >>> >>>> I suspect it's because NOX already comes with a component named >>>> "discovery". >>>> Try removing or changing the name of the existing one by adjusting its >>>> meta file (netapps/discovery/meta.json), or (better yet) renaming yours. >>>> >>>> -- Murphy >>>> >>>> On Apr 19, 2012, at 4:18 AM, Sander Vrijders wrote: >>>> >>>> > Hi >>>> > >>>> > I'm developing an application for NOX. >>>> > The code consists of multiple files, and is a topology discovery >>>> merged with a bittorrent tracker. >>>> > However, when I run the application (everything compiles fine), I get >>>> the following error: >>>> > >>>> > 'discovery' ran into an error: >>>> > discovery does not implement >>>> discovery_get_factory() nor get_factory() function >>>> > >>>> > I have added >>>> > >>>> REGISTER_COMPONENT(vigil::container::Simple_component_factory<Discovery>, >>>> Discovery); >>>> > to the bottom of my source file discovery.cc, if I add it higher up >>>> in the source file, or in another source file, >>>> > I mostly get a compiler error that says: get_factory is already >>>> defined. >>>> > What am I missing here? >>>> > >>>> > Kind regards >>>> > Sander >>>> >>>> >>> >>> >> >
