[comp.lang.c] Unrecognized switch using MS C 5.1

kbickel@sea.com (Ken Bickel) (09/18/90)

Does anyone know why the following error message is occuring when I
attempt to compile and link a simple C program using Microsoft's
CL.EXE (version 5.1):

   unrecognized switch error:  "NOI"

The error message occurs as the linking process is starting up.
I've tried installing the compiler on serveral different 286's using
the same installation steps, and the error will only occur on one of
the machines.  

The switch is /NOI[GNORECASE] which allows case sensativity in the
symbol names.

The command line used to compile looks like:

   cl prog.c graphics.lib

Thanks in advance,


-------------------------------------------------------------------------------
   Ken Bickel                         |     INTERNET - kbickel@sea.com 
   Systems Engineering Associates     |     UUCP - ...!ucsd!soledad!kbickel
   2204 Garnet Ave.                   |
   San Diego, CA 92109                |

swh@hpcupt1.HP.COM (Steve Harrold) (09/18/90)

>>> Does anyone know why the following error message is occuring when I
>>> attempt to compile and link a simple C program using Microsoft's
>>> CL.EXE (version 5.1):
>>> 
>>> unrecognized switch error:  "NOI"
>>> 
>>> The error message occurs as the linking process is starting up.
---------------
The LINK program that comes with MSC 5.1 is supposed to recognize that
switch.  Methinks you are inadvertently executing an older version of LINK.

Have you checked your search PATH for a directory that may contain such
a critter, perhaps a directory with a name like MSDOS that contains the
older version usually supplied with the DOS system?  Look also in your
current directory, where your source files are.

jeff@kfw.COM (Jeff Henkels) (09/18/90)

In article <1990Sep17.200600.9089@sea.com> kbickel@sea.com (Ken Bickel) writes:
>Does anyone know why the following error message is occuring when I
>attempt to compile and link a simple C program using Microsoft's
>CL.EXE (version 5.1):
>
>   unrecognized switch error:  "NOI"
>
>The error message occurs as the linking process is starting up.

What is happening is that CL is using the wrong link program.  Microsoft
has the habit of calling all their linkers LINK.EXE, including the linker
that comes as part of MS-DOS.  If the DOS subdirectory precedes the MSC
\BIN subdirectory in your path, CL (and all other Microsoft compilers) will
invoke the old DOS linker, which doesn't support /NOI (or several other 
options).  

Fortunately the fix is really easy; rename the DOS linker to anything
other than LINK.EXE.  Also, make sure that there aren't any old versions
of LINK.EXE floating around in your path; if MS Basic, FORTRAN, or
PASCAL are installed, their older LINK.EXE's might cause problems as well.
Any MS compiler can use the newer versions of LINK, but MSC can't use some
of the older versions, as you have discovered.

>I've tried installing the compiler on serveral different 286's using
>the same installation steps, and the error will only occur on one of
>the machines.  

Interesting.  I've also installed MSC on a number of machines, and this 
problem would occur on every single one.  Of course, all the machines had
the DOS LINK.EXE present and at the top of the path.

Anyway, if you make sure that MSC invokes its own linker, everything will
be ok.

Hope this helps.
Jeff

darcy@druid.uucp (D'Arcy J.M. Cain) (09/20/90)

In article <1990Sep17.200600.9089@sea.com> kbickel@sea.com (Ken Bickel) writes:
>Does anyone know why the following error message is occuring when I
>attempt to compile and link a simple C program using Microsoft's
>CL.EXE (version 5.1):
>
>   unrecognized switch error:  "NOI"
>
One thing that is important with Microsoft C is to erase the link program that
comes with DOS.  Yes I know they are both written by the same company but
if it finds the DOS link in the path before the one that comes with C you
will have all sorts of funny problems.  This one used to bite me every time
I upgraded or reinstalled DOS on my system.

-- 
D'Arcy J.M. Cain (darcy@druid)     |
D'Arcy Cain Consulting             |   MS-DOS:  The Andrew Dice Clay
West Hill, Ontario, Canada         |   of operating systems.
+ 416 281 6094                     |