By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,403 Members | 855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,403 IT Pros & Developers. It's quick & easy.

dlopen() & undefined symbol

P: n/a
Hi Everybody,

maybe you can give me a hint about this.

I implemented a simple singleton Factory that will (among other things) keep
a registry of objects.
Objects register themself in the factory in the following way:

static MyObject myInstance;

/*-------------------------------------------------*/
MyObject::MyObject()
/*-------------------------------------------------*/
{
MyFactory::Instance()->Register("MyObject", this);

}

I created two separated dynamic libs, one for the factory, and one for my
test class, and when trying to load the last one
(i.e: void* handledll = dlopen("libMyObject.so", RTLD_NOW), after the
factory one has been open, I get an undefined symbol error :

libMyObject.so: undefined symbol: _ZN16MyFactory8InstanceEv
any ideas?
Regards

Manuel


--
================================================== ======================
Manuel Diaz-Gomez | ATLAS Bldg. 32/SB-008 tel. +41 22 76 76304
CERN EP Division
CH-1211 Geneva 23
SWITZERLAND
================================================== ======================
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Manuel Maria Diaz Gomez wrote:
Hi Everybody,

maybe you can give me a hint about this.

I implemented a simple singleton Factory that will (among other things) keep
a registry of objects.
Objects register themself in the factory in the following way:

static MyObject myInstance;

/*-------------------------------------------------*/
MyObject::MyObject()
/*-------------------------------------------------*/
{
MyFactory::Instance()->Register("MyObject", this);

}

I created two separated dynamic libs, one for the factory, and one for my
test class, and when trying to load the last one
(i.e: void* handledll = dlopen("libMyObject.so", RTLD_NOW), after the
factory one has been open, I get an undefined symbol error :

libMyObject.so: undefined symbol: _ZN16MyFactory8InstanceEv
any ideas?
Regards

Manuel


Try asking in a Windows newsgroup, and please, give them more
context than you did here. Can you figure out what is going
on from the little bit of information you posted?
--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library

Jul 22 '05 #2

P: n/a
>
Try asking in a Windows newsgroup, and please, give them more
context than you did here. Can you figure out what is going
on from the little bit of information you posted?


I think a Unix or Linux group is more likely

news:comp.unix.programmer for instance.

john
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.