help-gplusplus
[Top][All Lists]
Advanced

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

Re: unloading dynamic libraries


From: Paul Pluzhnikov
Subject: Re: unloading dynamic libraries
Date: 11 Oct 2004 20:48:45 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

"John Max Skaller" <skaller@nospam.com.au> writes:

> Here is how they're linked:
> 
> g++ -w -Wl,-shared -Wl,--export-dynamic \
> -o rtl/libflx_dynamic.so rtl/flx_gc_dynamic.o

This is incorrect. Use this instead:

  g++ -w -shared 
     -o rtl/libflx_dynamic.so rtl/flx_gc_dynamic.o

--export-dynamic is only meaningful for *executables*, you should
not "hide" -shared from g++.

To see what difference this makes, run 'g++ -v -shared ...' and
'g++ -v -Wl,-shared ...' and compare the results.

> Here is how the mainline is built:
> 
> g++ -w -Wl,-Bdynamic -Wl,--export-dynamic -ldl  -o bin/flx_run \
> -Lrtl -lflx_dynamic rtl/flx_run_dynamic.o

Linking libraries before objects is bad style(TM).
*Always* link libraries *after* objects (it doesn't much matter
for shared libraries, but it matters a lot for archive libraries).

> The relevant code is part of the Felix project:
>   http://felix.sf.net

I am appalled: why in the world can't they use *reasonable* link
commands? Don't they know any better?

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]