KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q67761: GRAPHICS.LIB Cannot Be Used with Tiny Model

Article: Q67761
Product(s): See article
Version(s): 6.00 6.00a
Operating System(s): MS-DOS
Keyword(s): ENDUSER | s_quickc s_quickasm | mspl13_c
Last Modified: 6-FEB-1991

Programs written in the tiny model cannot use the graphics library
supplied with Microsoft C versions 6.00 and 6.00a. The graphics
routines are meant to be model-independent, so they are labeled as far
procedures. The linker does not allow far references in a tiny model
program and does not resolve the references to the graphics routines.

The sample source code below demonstrates this problem. The program
should be compiled with:

   cl /AT foo.c graphics.lib

For more information on building .COM files, query on the article
titled "Use of _far Keyword in Tiny Programs."

Sample Code
-----------

#include <graph.h>

void main(void);

void main()
{
   _setvideomode(_DEFAULTMODE);
}

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.