Question about what Static Libraries are...

im used to windows dll which gets loaded at runtime, are static libraries the same? the ones i link with -l on gcc?

i mean, if my app used libpng for example, and i compiled it to a single ELF executable and took it to another pc that have no libpng on it, will it work? or it will complain about missing lib?

thanks....

No. shared libraries are like dll's. The -l<name> thing links first against an .so (shared library), then against a static library. You can overcome that by linking --static.

Static libraries are used when the system is in an unknown state - /sbin/sh is the shell linked staticly so it can run without any external library. The other use for static linking is the case when you have written a custom library, and you want your code to run on machines that have stdc but may not have your library. Then you link that library staticly.
And you do not have to worry about it.

It will complain about missing libraries.

You can ldd /path/to/executable to see what dynamic libraries they're using or trying to use.