Frequently Asked Questions

The Slice compiler does not start—what should I check?

The various Slice compilers (slice2cpp, slice2java, and so on) launch the C preprocessor icecpp.exe as a sub-process. On Windows, if the directory containing icecpp.exe is not in your PATH, you can get an error message:

> slice2cpp Hello.ice
'icecpp.exe' is not recognized as an internal or external command,
operable program or batch file.

The same problem can arise under UNIX:

$ slice2cpp Hello.ice
sh: line 1: icecpp: command not found

Another common problem on Windows is an incorrect setting of the ComSpec environment variable. This variable specifies the location of the command line interpreter and, if incorrectly set, prevents the Slice compiler from being started by the development environment. For example, with Visual Studio, if ComSpec is set incorrectly, the build halts with an error:

------ Build started:  Project: test, Configuration: Debug Win32 ------
                 
Performing Custom Build Step
Project : error PRJ0019: A tool returned an error code: "Performing Custom  Build Step"

You can check the value of the ComSpec environment variable by opening a command window and displaying its value:

> echo %ComSpec%
C:\WINDOWS\system32\cmd.exe

Unless you are using a custom command line interpreter or have installed Windows in a location other than the default, the value should be the one shown above.

If ComSpec is incorrectly set and you need to change it, you can right-click on "My Computer" in the start menu and select "Properties" to open the system properties window. Select the "Advanced" tab and then click on "Environment Variables". In the "System Variables" section, select the ComSpec variable and press "Edit". It should look similar to the following:

You should change the value to:

%SystemRoot%\system32\cmd.exe

Press OK, and then OK again in the "Environment Variables" dialog. Note that, for the setting to take effect, you must restart any process that depends on the new value. For example, if you use Visual Studio, you need to close it down and restart it for it to recognize the new variable setting. Similarly, if you are using a command prompt and have changed the PATH setting, you need to start a new command window for the changed setting to take effect.

Copyright © 2008 ZeroC, Inc.