• As I'm compiling Slicer, the VTK files in the Tcl directory are generating errors similar to this:

    
    

    tcl/vtkImageAccumulateDiscreteTcl.cxx:1: syntax error before 'found'

    The automatic wrapper generator failed, since the parser wasn't able to read the input file properly. This is most likely due to saving the files in a different operating system format than the parser is running on. For example, if the source was transferred from Windows, but was being compiled under Linux.

    Here's how VTK works with Tcl/Tk. You can get shared libraries by compiling VTK. However, Tcl/Tk is able to use code from shared libraries only if they are in a specific format. Unfortunately, VTK is not in this format. That's why VTK has the ability to generate another shared library, which will be the "bridge" between the two. To do this, a special program parses all the VTK class headers and generates a new C file (called, for example, vtkImageAccumulateDiscreteTcl.cxx). The resulting C file will then be compiled. This parser has some limitations, though: it can only accept a subset of legal C and C++ syntax. If some error does occur, it will generate a C file containing only one line and this will make the compiler stop.

    If vtkImageAccumulateDiscrete is correct, you probably transferred the source from Windows and the sources are in DOS text mode. This is usually not a problem for compilers, but it may confuse the parser.

    If this is the case, use the dos2unix utility to convert vtkImageAccumulateDiscreteTcl.h in your local directory and compile again. This should give you an error message also, but, hopefully, with the next file, you will see a valid vtkImageAccumulateDiscreteTcl.cxx in your Tcl directory. Then you must convert the rest of your files to UNIX mode and compile again.