Code Comments
Programming Forum and web based access to our favorite programming groups."rdc02271" <rdc02271@yahoo.com> schrieb im Newsbeitrag > > Can any of you show me an example of what would be the perfect > solution for the libraries problems? Sorry, there's usually no such thing as a perfect solution. I recommend the book _Linkers and Loaders_ by John R. Levine (the moderator of this newsgroup) and the documentation of GNU Libtool: http://www.gnu.org/software/libtool/libtool.html. You might want to take a look at the relevant chapters in Kernighan and Ritchie, _The C Programming Language_ and Stroustrup, _The C++ Programming Language_. This will give you a clearer idea of what libraries are. You could also take a look at the source code of the GNU implementations of the C and C++ standard libraries. Generally speaking, a library for C will be written in C, a library for C++ in C++, etc. Assembler is platform-specific, so it's not a good choice for code that's intended to be ported to other systems. It's best suited for platform-specific optimizations, not for large programming tasks. > When you create a new langauge like D how do you create the > libraries to work with the operating system (for instance Windows) ? I can't help you with Windows, but in Unix-like systems, the operating system provides so-called "system calls" in order to make it possible for programs to communicate with the operating system. Implementations of C provide functions that map to these system calls, so that programmers can access them from their programs. 'creat', 'fork', 'exec', 'read' and 'write' are such system calls. The C standard does not specify what they do, since they may differ from system to system. Laurence Finston
Post Follow-up to this message"Skandinavisches Seminar" <skandgoe@gwdg.de> wrote: > Generally speaking, a library for C will be written in C, a library > for C++ in C++, etc. Even though this is true on the source code level, it seems that on the object code level, one way to do it is to mangle the code into a C-library. For example, when doing this, the C++ directive 'extern "C" ....' becomes a directive 'do not C++ mangle ..., but use C conventions directly'. -- Hans Aberg
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.