想在手机上做一些工作,但不是很想用android 的不开源的东西。所以编译工具arm-linux-gnueabihf-gcc,这个在用static编译选项时对多数程序,除编出来的有点大外都是可用的。但对getpwnam等.
Is linking statically (or: bundling all the libraries you need with your software) a solution? Even if it works technically, the associated costs might be to high. So unfortunately, the answer is probably no either.
-
Security: you shift the responsibility to update the libraries from the user of your software to yourself.
-
Size and complexity: just for fun try to build a statically linked GUI program.
-
Interoperability: if your software is a "plugin" of any kind, you depend on the software which calls you.
-
Library design: if you link your program statically to GNU libc and use name services (
getpwnam()
etc.), you end up linked dynamically against libc's NSS (name service switch). -
Library design: the library you link your p