MSVC++ Compiling Error

Posted on 2000-04-03
Medium Priority
Last Modified: 2008-02-20
I've been using MSVC++ 6.0 for some time now and just recently I have been unable to compile any workspace due to the following error (status window contents):

--------------------Configuration: 9_1 - Win32 Debug--------------------
Error spawning cl.exe

9_1.exe - 1 error(s), 0 warning(s)

Here is where the compilation stops.

I found the file and it does exist. I tried replacing it with the copy on the CD; didnt work. I also tried reinstalling as well as cleanly uninstalling and reinstalling to no avail...

I'm running Win 95 on a 300MHZ, 64Mb, plenty of disk space...

any ideas?
Question by:jkelly061597
  • 5
LVL 10

Expert Comment

ID: 2682556
reinstall your windows os as well (probably not need a un-install / re-install .. but just install over what you have).  Then try the uninstall/reinstall of VS.

You probably get more help in the Winodw 95 section area instead of C++, as it is not a C++ problem per se, but rather a problem with your system.

Accepted Solution

inpras earned 900 total points
ID: 2682707
do the following things
1. In Microsoft Developer Studio, on the Tools menu, click Options, then

   click the Directories tab. In the "Show directories for" drop-down list
   box, select Executable Files. The following paths should be listed,
   where drive C is the installation drive:

   If installed on Windows NT:

      C:\Program Files\DevStudio\SharedIDE\BIN
      C:\Program Files\DevStudio\VC\BIN
      C:\Program Files\DevStudio\VC\BIN\WINNT

   If installed on Windows 95:

      C:\Program Files\DevStudio\SharedIDE\BIN
      C:\Program Files\DevStudio\VC\BIN
      C:\Program Files\DevStudio\VC\BIN\WIN95

2. The "COMSPEC" environment variable should have the following value:

   If installed on Windows NT:


   To view and modify the COMSPEC environment variable in the NT Operating
   System, in Control panel, double-click the System icon, then click the
   Environment tab. The COMSPEC variable should be in the System Variables
   box. You can add or modify a variable using the Variable and Value edit

   If installed on Windows 95:


   In Windows 95, type SET in a DOS window; you will see the environment
   variables. Add or modify an environment variable by adding a SET command
   to the Autoexec.bat file, and rebooting.

3. If none of the above steps resolves the issue, make sure that installed
   Windows CE components are installed under a user account with
   administrative privileges.

4. If none of the above steps work, then uninstall Windows CE components
   (if installed) and uninstall Visual C++ 5.0. After uninstalling, delete
   the ..\DevStudio directory in the installed drive, saving any
   user-created projects before deleting. Then delete the following
   registry keys if they still exist.


   Then reinstall Visual C++ version 5.0. Verify that this installation
   works before installing any Windows CE components.

   WARNING: Using Registry Editor incorrectly can cause serious problems
   that may require you to reinstall your operating system. Microsoft
   cannot guarantee that problems resulting from the incorrect use of
   Registry Editor can be solved. Use Registry Editor at your own risk.

   For information about how to edit the registry, view the "Changing Keys
   And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and
   Delete Information in the Registry" and "Edit Registry Data" Help topics
   in Regedt32.exe. Note that you should back up the registry before you
   edit it. If you are running Windows NT, you should also update your
   Emergency Repair Disk (ERD).

hope this helps
LVL 10

Expert Comment

ID: 2682724
Here is what MS KB says about this... (this is for VC6 as opposed to VC5 in the proposed answer above)

BUG: "Error Spawning 'vcspawn.exe'. The build could not be performed."
ID: Q236092

The information in this article applies to:

Microsoft Visual C++, 32-bit Editions, version 6.0


Building applications from the integrated development environment (IDE) may fail, with the following message subsequently displayed in the output window:

Error spawning 'vcspawn.exe'. The build could not be performed.
The message does not identify why the build could not be performed.

There are several known causes for this message:

The environment used by the IDE does not have the correct directories to search for such tools as Vcspawn.exe.

The ComSpec environment variable may be incorrectly defined.

The system's NULL device may be disabled or missing (Microsoft Windows NT only).

Although all of these are valid reasons for a build to fail, Visual C++ does not provide enough information to identify the specific cause of the failure or how to resolve it.


The following are four suggested resolutions:

Resolution 1: Install or Re-Enable NULL Device (Windows NT Only)

There are slight variations on the displayed error text. These variations can sometimes help to identify what is causing the problem. If the error text resembles the following, you may have problems opening the NULL device:
Cannot start tool. The system cannot find the file specified. The system cannot find the file specified. Error spawning 'vcspawn.exe'. The build could not be performed.

Use the following steps to check on the NULL device:

From Control Panel, open the Devices manager.

Look for the Null device in the list of devices. If you do not have a Null device, you must reinstall Null.sys.

The Null device should show Status=Started and Startup=System.

To correct the Status setting, select the Null device and click Start.

To correct the Startup setting, select the Null device, click Startup, and then select System.

Resolution 2: Correct the IDE Environment

If you have the following error text variation, you probably have errors in the ComSpec definition or the IDE environment, which specifies where to find the tools:

Cannot start tool. The operation completed successfully. Cannot start tool. Error spawning 'vcspawn.exe'. The build could not be performed.

See Resolution 4 below for information about correcting the ComSpec definition. To correct the IDE environment:

From the Tools menu, click Options.

Click the Directories tab, and under Show Directories for, select Executable Files.

The following five directories should be listed in this order: Correct the directory list to point to valid directories:

(Your VC install location)\Common\MSDev98\Bin;
(Your VC install location)\VC98\BIN;
(Your VC install location)\Common\TOOLS;
Your Windows system directory (often this is C:\WINNT\system32)
Your Windows directory (often this is C:\WINNT)

Test these directories by double-clicking them, and then click the ellipses [...]. Alternatively, copy the directory to the clipboard. Then, on the Start menu, click Run, and paste the directory into the Open text box. This method should bring up Windows Explorer with that directory.

To add a new directory, double-click an empty box and then click the ellipses [...].

NOTE: The "...\MSDev98\Bin" directory contains Vcspawn.exe and should be first in the list.

Resolution 3: Use the System Environment

An alternative way of specifying the executable paths is to use the /USEENV argument when starting MSDEV (Visual C++). The command line resembles the following:


This action forces Visual C to use the system environment settings rather than the directories specified in Options under the Tools menu. This will help if the system environment variables are all correct; for example, if you can build successfully from a command prompt.

NOTE: Resolution 2 is usually recommended over using the /USEENV switch. For additional information about a bug that was fixed in Service Pack 3, please click the article number below to view the article in the Microsoft Knowledge Base:

Q216854 FIX: Running msdev /useenv Once Causes Environment To Be Used Permanently

Resolution 4: Correct the ComSpec Environment Variable Definition
If the paths look correct (see Resolution 2), the problem may be with the ComSpec environment variable. The ComSpec environment variable identifies the command prompt executable. On Windows NT, this usually resembles the following:

On Windows 95 or Windows 98, it typically resembles the following:

To check, set, or change the value of the ComSpec environment variable:
On Windows NT:

From the Start menu, point to Settings, then click Control Panel.

Double-click the System icon (this action displays all existing environment variables and their values).

Add or modify the ComSpec variable, as necessary.

On Windows 9x:

From the MS-DOS prompt, enter set ComSpec. This action either displays the current value of the ComSpec environment variable, or "Environment Variable ComSpec not defined."

Edit the Autoexec.bat file to modify or add ComSpec to the system as necessary.


Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


For additional information about this subject, please click the article numbers below to view the articles in the Microsoft Knowledge Base:

Q189138 PRB: "error spawning empfile.exe" Building WINCE Application
Q188720 PRB: Error Executing ~vcecho!Compiling

Additional query words:

Keywords          : kbVC600bug kbDSupport
Version           : winnt:6.0
Platform          : winnt
Issue type        : kbbug

Last Reviewed: August 26, 1999
) 1999 Microsoft Corporation. All rights reserved. Terms of Use.

Send feedback to MSDN.Look here for MSDN Online resources.
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

LVL 10

Expert Comment

ID: 2682733
NOTE inpras answer is (also) just a copy of the following MS KB article .. although he removed the reference to the MS KB title and Q-number:

PRB: Error Executing ~vcecho!Compiling
ID: Q188720

Note that the above article says it applies only to VC 5.0.  You are using VC 6.0, so be VERY carful if you attempt to use this answer .. it MAY not have the same effect as VC5 and VC6 are different in some/many ways.

LVL 10

Expert Comment

ID: 2710441
Dod you heed my warnings about inpras answer (ie. it was for VC5 and NOT for VC6) ?????

Author Comment

ID: 2710553
yah thanks... I apreciate it.
LVL 10

Expert Comment

ID: 2710562
but inpras got the points ... oh well :-(

at least I'm appreciated :-)

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question