mohi <mo**********@g mail.comkirjuta s:
hello every one ,
this may be very basic question and may be a bit out of topic ,,
can anyone please tell me what are the functions of runtime library
and are they the one which create the program stack, manages heap???
The "runtime library" usually refers to the C runtime library, which
contains implementations of functions like fopen() and printf(). Stack
management is typically mostly done by the compiler without any library
help, except for some things like alloca(). OTOH, heap management is
usually done by runtime library (malloc(), free(), etc.)
For performing its tasks the runtime library often calls the underlying
OS functions like open() or CreateFile(). One of the tasks of the runtime
library is to provide a portable interface to C programs.
For C++ programs there is also C++ runtime library (called STL usually),
which contains implementations of things like std::ostream and
std::vector. For performing its tasks, it may use the underlying C
runtime library or call the OS functions directly.
If you are working on Linux, then the man pages contain C runtime library
functions in section 3 and OS calls in section 2. This number is
displayed right after the function name in the man page header.
Unfortunately, the man system usually does not contain any C++ library
documentation.
and how can i find out that does my compiler (or linker) produces
dynamically linked runtime libraries (if so how can i make it to do it
statically on gnu g++ on fedora c8)
There is probably some linker switch, but why should you care? In any
case, the runtime libraries are normally not produced by your compiler,
they are preinstalled, possibly both the dynamic and static versions.
hth
Paavo