[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Static linking



Johannes Tanzler wrote:

>On Tue, 2003-09-30 at 17:56, Russell Shaw wrote:
>  
>
>>How do i get "pkg-config gtk+-2.0 --libs" to put out -static
>>instead of --export-dynamic ?
>>    
>>
>
>Try 
>
>  `pkg-config --libs gtk+-2.0` -static
>
>The explicit "-static" overrides "--export-dynamic".
>
>  
>
hmmm,
        --export-dynamic [ is an option to ld ]
        -static                   [ is a linker option to gcc ]

Usualy object files are linked according to the preceeding option passed,
i.e.:

gcc -o prog  prog.c  -shared -lone -static -ltwo

will create a program out of prog.o and libtwo.a
that links dynamicly with the object file `libone.so'

Are you sure that gcc doesn't pass `--export-dynamic' to the linker if it
finds `-static' on its command line ?

I could use some enlightenment on this subject ;-)

Cheers,
                                -Tristan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]