Re: Overview



dvdsum a écrit :
Hello, my english is very poor, excuse me. I want that someone explains
several things.
Ok,

Windows, as well as other modern operating systems, gives a set of
functions called API. The programmer can access to the functionalities
of the system by them. Is it right? The functions are grouped, for
example kernel and user. Now, in a compiler as gcc what does
libkernel32.a represent? The dll are written in C and then why do we
use libkernel32.a and not kernel.dll?
What are files lib*.a? Thank you very much!

Bye

dvddum


Compiled functions are grouped in files called "libraries". Those files
contain several compiled functions that perform various functions like
drawing a line, opening a file, making coffee, etc.

Libraries are normally called file.lib under windows, or libfile.a under
Unix. Since gcc comes from Unix, it names its libraries .a instead of
..lib.

Libraries can come in two "flavors". Normal "static" libraries, that
contain the code of the functions, and "import" libraries that are
just stubs that tell the dynamic linker/loader where those functions
are actually defined. When you use a dll (or a shared object using Unix
naming conventions) your libraries allows your executable to be
associated to a dynamic library (a .dll under windows a .so under
Unix). In your example libkernel32.a just associates some of
the functions that you use in your program with kernel32.dll.

Under windows you can use the dll directly (without linking to it) by
using the LoadLibrary API. Under Unix you use dlopen() or similar
functions. Note that you must link the dll that contains the
LoadLibrary API STATICALLY, you can't load kernel32.dll dynamically
since it containes the LoadLibrary API. In the same manner
it doesn't make sense to load the library that contains dlopen()
using dlopen() :-)

.



Relevant Pages

  • Re: Programmer knowledge
    ... >> The C library doesn't have windows or controls at all. ... It's not going to stop working unless the API ... are not part of MFC, nor necessary in any way to its use. ... for rare cases, it is only for writing libraries), or that dockable ...
    (comp.programming)
  • Re: digital image processing... newbie help
    ... >Re-invent is a common negative sound-bite. ... And I was referring to Windows and calling windows... ... >than those writing libraries. ... >same threads about writing C in Forth, writing Unix in Forth, ...
    (comp.lang.forth)
  • Re: UNIX libraries in windows
    ... I need to find equivalent windows libraries for the following unix ... On Unix systems most of the system calls are implemented in the C library, ... On Windows, you can generally use Unix emulation systems such as Cygwin. ... Unfortunately sproc is not a Posix function. ...
    (comp.lang.c)
  • Re: Free Ada83 compiler for older Solaris/SPARC or IRIX?
    ... That is the reason why I do not like this way very much: Code where a major part of development is done for the Windows operating system is usually not easy to compile on UNIX machines: Poor makefiles, ... The makefiles are very typical for large 'auto' tools style makefiles. ... just the Ada part -- the libraries themselves). ...
    (comp.lang.ada)
  • Re: system calls
    ... If you are writing a WIndows App, you are expected to program it using the Windows ... If you are writing a POSIX app, use the POSIX API, and be prepared for whatever it ... to a Unix API, should I write to Gnome, or KDE, or what? ...
    (microsoft.public.vc.mfc)