By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,855 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,855 IT Pros & Developers. It's quick & easy.

c++ runtime library

P: n/a
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???

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)

mohan
Aug 21 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
mohi wrote:
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 list is too long to put in a newsgroup posting. Please get a copy
of the Standard (better both C and C++), you'll have all the information
you need. Or get a copy of "The C++ Standard Library: A Tutorial And a
Reference" by Nicolai Josuttis.
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)
Your compiler should have the documentation tell you about the ways to
achieve what you need. In lieu of the documentation you could use a
book or some other third-party document. Check the technical section in
your nearest book store. Also, ask in one of the 'comp.os.linux.*'
newsgroups.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 21 '08 #2

P: n/a
mohi <mo**********@gmail.comkirjutas:
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

Aug 21 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.