![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#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. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
C++ itself supports global initializations of things. You can do things like:
Code:
int global_variable=some_global_function(); |
|||
| Google The UNIX and Linux Forums |