473,785 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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::MyObj ect()
/*-------------------------------------------------*/
{
MyFactory::Inst ance()->Register("MyOb ject", 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("libMyOb ject.so", RTLD_NOW), after the
factory one has been open, I get an undefined symbol error :

libMyObject.so: undefined symbol: _ZN16MyFactory8 InstanceEv
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 4455
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::MyObj ect()
/*-------------------------------------------------*/
{
MyFactory::Inst ance()->Register("MyOb ject", 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("libMyOb ject.so", RTLD_NOW), after the
factory one has been open, I get an undefined symbol error :

libMyObject.so: undefined symbol: _ZN16MyFactory8 InstanceEv
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.l earn.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
1770
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) But it errors out on AIX ( xlC va6) with below errors:- ld: 0711-317 ERROR: Undefined symbol: ._STL::ios_base::_Loc_init::_Loc_init() ld: 0711-317 ERROR: Undefined symbol: ._STL::ios_base::Init::Init() ld: 0711-317 ERROR: Undefined symbol:...
4
5733
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 -q64 option in xlC compiler. But, when we link all these libraries to one of the main applications, we are getting the following errors: ld: 0711-317 ERROR: Undefined symbol: .FxCharFile::good() const ld: 0711-317 ERROR: Undefined symbol:...
4
4022
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: 1. the sources compiled with gcc 4.1.2 crash with illegal instruction error: (running my application)
8
18053
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: undefined symbol yylex. What might have went wrong?
1
5550
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 variables:-ms_uCapacity ,ms_uAllocatedCount , ms_uLockCapacity ,ms_pmutex -ld < yamit/apps1.out Undefined symbol: _Q23m5tt5CPool1ZQ23m5t10CMarshaler$ms_uCapacity (binding 1 type 0) Undefined symbol: _Q23m5tt5CPool1ZQ23m5t10CMarshaler$ms_uAllocatedCount
1
4914
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 symbols. See the output from configure and make below. svnadm /svn/build/python-2.5.0>env CC=cc CXX=xlC ./configure --prefix=$base_dir \ checking MACHDEP... aix5
1
2788
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 module, I am importing only the sys module. Py_SetProgramName("/usr/bin/python"); Py_Initialize(); char* argv = { "python","-v",""}; PySys_SetArgv(2,argv);
1
6061
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 50002 -s wse - u db2inst2 db2inst2 /opt/ibm/db2/V9.5/bin/db2greg: symbol lookup error: /opt/ibm/db2/V9.5/
6
19028
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, also when I do nm on this shared lib, I can see symbol, this is standalone lib, not linked with executable. if ((handle = dlopen(libname, RTLD_NOW)) == NULL) { printf("ERROR: cannot load library: %s, %s\n", libname,...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9958
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7506
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.