简体   繁体   中英

Static linking C library on Solaris using SunStudio

I know that in Solaris 10 Sun now Oracle don't provide static version of C library ie libC.a but I check that same thing is not possible using Sun Studio either, I was under impression that C library are provided by Compiler just like Visual Studio provides C runtime libraries.

So is on Solaris C libray is provided by system only and there is no way to get static version of libC.a compatible on Solaris 10? Thanks

Not sure you can find one. This is "by design" - while the stdlib API are stable, the internals change between releases of the OS, so they force everyone to link dynamically to avoid breakages.

Using dynamic version in theory keeps your executables portable across different Solaris releases (but it is not guaranteed).

If you really want to have a completely self-contained executable, you probably should use GCC with its own stdlib.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM