Compilation Error vtk release 5.6.1 in Fedora 15
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Trying to compile the release 5.6.1 in Fedora 15 I got an error. In the class VTK/Utilities/vtkmetaio/metaUtils.cxx the compiler doesn't recognize the variable ptrdiff_t and it recommended to change it to std::ptrdiff_t.
I did the change and I got vtk compiled.
The method that I modified was "bool MET_StringToWordArray(const char *s, int *n, char ***val)" and the final result is:
bool MET_StringToWordArray(const char *s, int *n, char ***val) { std::ptrdiff_t l = strlen(s);
std::ptrdiff_t p = 0; while(p<l && s[p] == ' ') { p++; }
*n = 0; std::ptrdiff_t pp = p; bool space = false; while(pp<l) { if(s[pp] == ' ' && !space) { (*n)++; space = true; } else { space = false; } pp++; } pp=l-1; if(s[pp] == ' ') { while(pp>=0 && s[pp] == ' ') { (*n)--; pp--; } } else { (*n)++; }
*val = new char *[*n];
std::ptrdiff_t i, j; for(i=0; i<*n; i++) { if(p == l) { return false; }
(*val)[i] = new char [80];
while(p<l && s[p] == ' ')
{
p++;
}
j = 0;
while(p<l && s[p] != ' ')
{
(*val)[i][j++] = s[p++];
}
(*val)[i][j] = '\0';
}
return true; }
I hope this will help the development of future releases.
Alfredo Morales Pinzón.