Quantcast
Channel: User Nicholas Knight - Stack Overflow
Viewing latest article 20
Browse Latest Browse All 40

Answer by Nicholas Knight for By default, does gcc link to static or dynamic standard library?

$
0
0

It is technically system dependent, but on most systems you're likely to develop for, the answer is "dynamic".

A few systems (mostly very old, embedded, or otherwise specialized) do not support dynamic linking at all, but most developers are unlikely to care about those systems. On those systems, the linker will of course default to linking statically (unless whoever did the port screwed up :)).

Some systems also do not offer static versions of their standard libraries, so you can't statically link them.

On many systems (especially any typical Linux system), you probably have a utility called ldd. You can use ldd <file> to check if it's dynamically linked to the standard library (assuming you know for sure what the library is called, it's usually libc though).


Viewing latest article 20
Browse Latest Browse All 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>