pointers to objects in shared library (Linux)

Z

Zorro

Is there something in particular I must know about Linux Shared libs?
Any help will be appreciated. Here is the question.

I am passing a pointer, to a pointer, to an object that will be
created in a shared library. This is as simple as I am saying it, and
it works fine with a dll. However, in Linux, as soon as the call
returns the pointer to the object in the library seems to be pointing
to junk, and I get seg-fault. The object is not destroyed to be sure,
in fact it is created via new, and not deleted at that time.

Thank you.
 
V

Venu Yanamandra

Is there something in particular I must know about Linux Shared libs?
Any help will be appreciated. Here is the question.

I am passing a pointer, to a pointer, to an object that will be
created in a shared library. This is as simple as I am saying it, and
it works fine with a dll. However, in Linux, as soon as the call
returns the pointer to the object in the library seems to be pointing
to junk, and I get seg-fault. The object is not destroyed to be sure,
in fact it is created via new, and not deleted at that time.

Thank you.

can you atleast post a sample code?

Regards,
Venu Yanamandra
 
Z

Zorro

can you atleast post a sample code?

Regards,
Venu Yanamandra

Actually, I must thank you for asking. It has been three days of
frustration to find where the problem was, and at least a whole day of
so why is this happening (after locating the problem).

I noticed that template structures where not identical, something was
changed (in near million lines) on Windows, but not on Linux. So, the
structure pointed to in the library, was not identical to structure
pointed to in the loader of the library.

I appreciate quick response. Have a great day Venu.
 
V

Venu Yanamandra

Actually, I must thank you for asking. It has been three days of
frustration to find where the problem was, and at least a whole day of
so why is this happening (after locating the problem).

I noticed that template structures where not identical, something was
changed (in near million lines) on Windows, but not on Linux. So, the
structure pointed to in the library, was not identical to structure
pointed to in the loader of the library.

I appreciate quick response. Have a great day Venu.- Hide quoted text -

- Show quoted text -

Thank you Zorro. :)

Regards,
Venu Yanamandra
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top