Micro C Usage Demonstration

To compile with MICRO-C you must specify the switches "-fop" for the CC
command. Please see the following messages below for a more descriptive
example from correspondence with FreeDOS's original founder, James Hall...

Morgan Toal <mtoal@crsd.k12.ak.us> April 1998

  ------------------------------------------------------------------------

Subject:         Compiling with MC??
Date:            Sat, 11 Oct 1997 23:59:38 -0500
From:            James Hall <jhall1@isd.net>
Organization:    Not very organized
To:              hannibal@alaska.net

Hannibal,

Been a long time.  I'm getting back to FreeDOS (again!) and would like
to start writing code again.  I downloaded the recent FreeDOS files,
including MC, ARROW, and VAL.  I followed the instructions in \MC\MC.DOC
and \MC\READ.ME, but for the life of me I can't get the thing to compile
my code.

For a simple program that looks like this:

#include <stdio.h>

main()
{
        printf ("Hello world\n");
        exit (0);
}

I get the error message:

C:\TEMP\C>cc hello.c
DDS MICRO-C PC86 Compiler v3.14
hello.c: Compile... hello.c(1): Unable to open: <stdio.h>
MCC.EXE failed (254)

Yes, MCDIR is set to C:\MC
and MCTMP is set to C:\TEMP\
and TEMP is set to C:\TEMP

What am I doing wrong?

--
Those who do not understand Unix are condemned to reinvent it, poorly.
                -- Henry Spencer

  ------------------------------------------------------------------------

Subject:    Re: Compiling with MC??
Date:       Mon, 13 Oct 1997 00:12:48 -0800
From:       "M. \"Hannibal\" Toal"
To:         James Hall
References: 1

Hi James! Good to hear from you.

You need to specify switches as such:

    cc hello.c -fop

This will do the trick.

The 'p' switch is the big deal, because without it MC does not
try to use the pre-processor, hence the inability to locate
stdio.h.

You will pretty much always need to use this set of switches,
unless you are trying to do something special (i.e. unoptimized
code, bare asm output, etc.)

Check the web page at freedos.org in the user guide under faq's
about Micro-c.

>From the manual... (though Dunfield does not come right out and
say so, but it's inferred if you read closely)

       2.1 The CC command

             The format of the 'CC' command is:

                              CC  [options]

          2.1.1 Command line options

                -A      - produce ASSEMBLER (.ASM) output file
                -C      - Include 'C' source as comments in ASM files
                -F      - Fold identical string constants.
                -K      - KEEP all temporary files (do not delete)
                -L      - Produce LINKABLE (.OBJ) output file.
                -O      - OPTIMIZE the output code (using MCO)
                -P      - use the extended PRE-PROCESSOR (MCP)
                -Q      - QUIET mode (suppress informational messages)
                -S      - Use SMALL/.EXE model (Default is TINY/.COM)
                H=mcdir - specify MICRO-C home directory
                T=mctmp - specify prefix for TEMPORARY files
                name=xx - Predefine macro symbol (use with -P only)
