12.07.2015 Views

PGI User's Guide

PGI User's Guide

PGI User's Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Creating and Using Dynamic-Link Libraries on Windows–d–r–t–v–xDeletes the named object files from the library.Replaces in or adds the named object files to the library.Writes a table of contents of the library to standard out.Writes a verbose file-by-file description of the making of the new library to standard out.Extracts the named files by copying them into the current directory.ranlib commandSyntax:Options122The ranlib command is a wrapper that allows use of legacy scripts and makefiles that use the ranlibcommand. The command actually does nothing; it merely exists for compatibility.The syntax for the ranlib command is this:ranlib [options] [archive]The options available for the ranlib command are these:–helpShort help information is printed out.–VVersion information is printed out.Creating and Using Dynamic-Link Libraries on WindowsThere are several differences between static and dynamic-link libraries on Windows. Libraries of either typeare used when resolving external references for linking an executable, but the process differs for each type oflibrary. When linking with a static library, the code needed from the library is incorporated into the executable.When linking with a DLL, external references are resolved using the DLL's import library, not the DLL itself. Thecode in the DLL associated with the external references does not become a part of the executable. The DLL isloaded when the executable that needs it is run. For the DLL to be loaded in this manner, the DLL must be inyour path.Static libraries and DLLs also handle global data differently. Global data in static libraries is automaticallyaccessible to other objects linked into an executable. Global data in a DLL can only be accessed from outsidethe DLL if the DLL exports the data and the image that uses the data imports it.To access global data, the C compilers support the Microsoft storage class extensions:__declspec(dllimport) and __declspec(dllexport). These extensions may appear as storageclass modifiers and enable functions and data to be imported and exported:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!