Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!charyb!jeff From: jeff@kfw.COM (Jeff Henkels) Newsgroups: comp.lang.c Subject: Re: Unrecognized switch using MS C 5.1 Message-ID: <1990Sep18.160009.26640@kfw.COM> Date: 18 Sep 90 16:00:09 GMT References: <1990Sep17.200600.9089@sea.com> Reply-To: jeff@kfw.com (Jeff Henkels) Distribution: usa Organization: KFW Corporation, Thousand Oaks, CA Lines: 36 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