TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: CHRIS ADAMS
from: DAVE NAVARRO
date: 1995-09-13 12:22:00
subject: Linking OBJ files... 3/3

(Continued from previous message)
    FAR calls / returns to / from functions and FAR pointers for access to
    variables.  If you need more than 64k of code then use the HUGE model.
    The switches are as follows:
      /AL  compiles using the LARGE memory model
      /AH  compiles using the HUGE  memory model
    So a complete command line would look something like this:
       CL /c /AL /Gs mymod.c
    This would generate "mymod.obj" compiled with the large memory model,
    ready to be linked into you PowerBASIC program.
    In the command line above the switches have the following meaning:
      /c   Compile to an .OBJ file (no linking)
      /AL  Use the LARGE memory model (use /AH for the HUGE model)
      /Gs  No stack checking (see "About the /Gs switch", below)
   3. C RTL (Run Time Library) functions
   -------------------------------------
    See Part I section 4, above.
   About the /Gs switch...
   -----------------------
   The Microsoft compiler defaults to including code to do stack checking
   in an effort to make your code more bullet-proof.  This is a good thing.
   The only problem with it, in this case is that it requires the C runtime
   library to be available, and as we've already seen, it isn't.  If you do
   not use the /Gs switch to turn off stack checking, PowerBASIC will report
   an unresolved external for the identifier _ANCHKSTK.
------------------------------------------------------------------------------
-
  Well, that's about it, for linking external C routines to your PowerBASIC
  programs using Borland or Microsoft C compilers.  Other compilers should
  be just as easily accomodated.
  p.s.  One final note: The switches on the command lines above (for both
        Borland and Microsoft products) ARE case-sensitive.  So, make sure
        you type them in exactly as shown in this text.
---
 * QMPro 1.53 * VaporHelp - Verb; {call MicroSoft Tech Support}
--- WILDMAIL!/WC v4.12 
---------------
* Origin: Toast House * (314) 994-0312 * (1:100/560.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.