Why would it be impossible to fully statically link an application?

后端 未结 2 731
忘掉有多难
忘掉有多难 2021-02-01 08:09

I\'m trying to compile a statically linked binary with GCC and I\'m getting warning messages like:

warning: Using \'getpwnam_r\' in statically linked application         


        
2条回答
  •  不思量自难忘°
    2021-02-01 08:30

    AFAIK, it's not impossible to fully statically link an application.

    The problem would be incompatibility with newer library versions which might be completely different. Say for example printf(). You can statically link it, but what if in a future that printf() implementation changes radically and this new implementation is not backward-compatible? Your appliction would be broken.

    Please someone correct me if I'm wrong here.

提交回复
热议问题