August 2, 2011

mike4 mike4
Lab Rat
70 posts

shared vs dynamic libs

 

Hi
I saw that below with another project. What exactly is that? shared would need some *.so to go with? But there’s only the executable shipped.

- what does -rdynamic?

- “ -ggdb?

- with -shared *.so libs should be shipped with the executable?

Thanks Michael

LNFLAGS+=-shared -rdynamic -nodefaultlibs -m32 -ggdb -L/usr/lib32 -L../libavionics -L../libogl -L$(LUAJIT)/lib

3 replies

August 2, 2011

Franzk Franzk
Lab Rat
830 posts

mike4 wrote:
Hi
I saw that below with another project. What exactly is that? shared would need some *.so to go with? But there’s only the executable shipped.
The executable probably depends on the system versions of the shared object.

– what does -rdynamic?

My guess: It enables dynamic relocation [en.wikipedia.org]) or something like that. It is only available in shared objects.

– “ -ggdb?
Add debugging symbols for GDB

– with -shared *.so libs should be shipped with the executable?

The ones not likely to be found installed on the target system (those in your project). Libraries like Qt can be held required and are not expected to be delivered with your application or library.

 Signature 

“Horse sense is the thing a horse has which keeps it from betting on people.”—W.C. Fields

http://www.catb.org/~esr/faqs/smart-questions.html

August 2, 2011

mike4 mike4
Lab Rat
70 posts

Thanks but why not simply use:
-dynamic

instead of:

-shared -rdynamic

August 2, 2011

Franzk Franzk
Lab Rat
830 posts

Legacy probably. I think -shared -rdynamic was required first, then the gcc people found it was used together a lot and introduced -dynamic which is synonymous to the other version. The original was left available to not break older builds.

But that’s just assuming :)

 Signature 

“Horse sense is the thing a horse has which keeps it from betting on people.”—W.C. Fields

http://www.catb.org/~esr/faqs/smart-questions.html

 
  ‹‹ getting locale information from string      [Solved] QMetaObject::className for derived type ››

You must log in to post a reply. Not a member yet? Register here!