Hi,

I try newest code and i see the constructor is not execute for SDL , i think
this
happen on linking, that
this file is not add because no functions are need from netsurf direct.is
that possible
?


maybe its same problem as this.

""""
http://gcc.gnu.org/ml/gcc-help/2003-04/msg00135.html

Paco Moya <Francisco dot Moya at uclm dot es> writes:

> A simple example illustrates the problem:
>
> p.c------------------------------------
>
> void f(void) __attribute__((constructor));
>
> void f(void)
> {
>   printf("Hola\n");
> }
>
> main.c----------------------------------
>
> int
> main()
> {
>   exit(0);
> }
> ---------------------------------------
>
> Now try compiling the example:
>
> gcc -c p.c
> gcc -c main.c
> gcc -o first main.o p.o
>
> And also in this way:
>
> gcc -c p.c
> gcc -c main.c
> ar rcs libp.a p.o
> gcc -o second main.o libp.a
>
> The second version does not work as expected!
>
> Any clue?

As main.o doesn't reference any symbol defined on p.o, that object
module is not picked from the library. For static libraries, the
linker only uses those object modules that defines symbols referenced
on previous objects. The first case works because you force the
inclusion of p.o on the executable by explicitly mentioning it on the
object list.

IIRC, ld has a switch for forcing the inclusion of all the objects
contained on a library.


Oscar
"""""


Bye


Reply via email to