[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Entry point i shared lib filer



Kasper Hauge <sslug@sslug> writes:

> Har du et eksemple der virker ??

> void start () __attribute__ ((constructor));
> void slut () __attribute__ ((destructor));

Der er sket noget mærkeligt med de constructor/destructor attributes
siden jeg sidst prøvede dem. Hvis du laver en klasse af statisk
varighed med en constructor virker det:

static class Start {
  public:
  Start::Start() {
    printf("Starter..\n");
  }
} StartClass ;

Men! Når du har mindst een sådan en constructor begynder funktionerne
med __attribute__ constructor/destructor også virke.

Såh, der må være noget kode der kalder alle constructor/destructor
markerede funktioner men som kun virker hvis der er en rigtig statisk
constructor tilstede.


-- 
===============================================================
<sslug@sslug>     Herlev, Denmark     Software Designer
<URL:http://www.andreasen.org/>   <*>   Eicon Networks Research
===============================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *