473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

dlopen() & undefined symbol

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
2 4413
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
>
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: pervinder | last post by:
Hi, I have a c++ application which depends on some other libs which uses stlport When i build the application, it works fine on sun/linux/hp platform. (provided the .a for the dependency libs) ...
4
by: r.nikhilk | last post by:
Hi, We are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by including the...
4
by: Mathias Waack | last post by:
Hi, I've embedded python into a legacy application. It works - most of the time. In some special situations the app crashes executing the "import random". There are two different situations: ...
8
by: pavan734 | last post by:
Hello, Please excuse me as Iam not posting this to correct group. I have a parser code obtained from flex command. I have many other files. When I compile them Iam getting a message like:...
1
by: yamitmehta | last post by:
When I compile to code using g++arm of VxWorks 5.5 and put it on my board i get the follwing undefined symbols:- Cpool and Csingleton are template classes. CPool has the static member...
1
by: Justin Johnson | last post by:
Hello, I'm trying to build Python 2.5.0 on AIX 5.3 using IBM's compiler (VisualAge C++ Professional / C for AIX Compiler, Version 6). I run configure and make, but makes fails with undefined...
1
by: Borse, Ganesh | last post by:
Hi, Can you please guide me for the following problem? The call to "PyImport_ImportModule("cStringIO");" is failing with an error of "undefined symbol: PyObject_SelfIter". Before importing this...
1
by: Michel Esber | last post by:
People, Environment: Linux AS4 I have just installed db2 v9.5 + Fixpak 2 on a machine that has db2 v8 up and running, but I am unable to create and instance: # ./db2icrt -a SERVER -p...
6
by: tvnaidu | last post by:
opening shared lib with dlopen, gets success, but dlsym returns an error saying undefined symbol, also passing "-rdynamic" during linking this shared lib, any idea?. dlopen success, dlsym gets error,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.