I\'m wondering what the -static option on gcc does. I need this option when compiling a certain application, however when I do I get the following error:
gcc
The -static
flag forces the linker to accept only static libraries and not any shared libraries.
If you want to use -static
, you have to ensure that you have a static version of the C library installed, which might be tricky to find (most systems do not have a static C library any more). Or you have to cancel the effect of -static
. However, in the example, that would defeat the purpose of -static
since the only library linked is (implicitly) the C library.