The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ELF format shared library? wntrmead High Level Programming 11 11-16-2007 11:19 AM
Shared memory in shared library DreamWarrior High Level Programming 12 05-30-2007 01:33 PM
shared library areef4u UNIX for Advanced & Expert Users 1 07-31-2006 11:14 PM
Creation of Shared library sarangb SCO 0 06-17-2005 04:51 AM
Shared Library rajashekaran High Level Programming 2 08-03-2002 10:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2006
Registered User
 

Join Date: Jun 2006
Posts: 1
Writing a shared library --- any initialization routine?

Hi, all. IM new to this forum.

I wanted to write a shared library for my program. However, I need the library to have some self initialization routines before anyother functions in the library are called.

Like the ones available for gcc __attribute__ ((constructor)).

I tried int _init(void), it didn't work. And I read thru many library documents but didn't find anything particular.

Is there any way that I can do this? Or is there even such mechanism to allow you self initialize in a library before anything happens?

My developing environment: Solaris 9 with CC (using C++, library contains class objects)

Thank you for your kind help.
Reply With Quote
Forum Sponsor
  #2  
Old 06-22-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 989
C++ itself supports global initializations of things. You can do things like:
Code:
int global_variable=some_global_function();
This would be illegal in C, but is legal in C++.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0