> Back in the day (Borland days), there used to be a pragma directive that > could be used to automatically call a function with-in the library on > startup. I know something like this must exist in gcc but I can't find > it. I think the approved method is to use constructor functions: void cons_func(void) __attribute__((constructor)); void cons_func(void) { /* Do initialisation stuff here */ } Note that it isn't hugely well defined what order constructor functions get called in, so be careful when calling other libraries. Steven.