64-bit build fails using MinGW-w64
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When trying to build VTK (SVN trunk) on Windows 7 using MinGW-w64 (gcc/g++ 4.4.5 20100604) I run into a number of issues, namely:
- Quite a few places where pointers are converted to integers to
be used as ids, which on a 64-bit system failed due to loss of precision
when casting pointers to e.g. long.
I replaced the casts to intptr_t, which seems to be the natural choice for this operation (and should be available on all C99/C++0X compatible compilers). - On MinGW-w64 one cannot use __int64 type together with long long, something that apparently was addressed in CMake/vtkTestTypes.cmake (according to the svn history), however, the ruleset there still did not work for me and I has to force VTK_TYPE_USE___INT64 to 0.
- Two Windows symbols (GWL_WNDPROC and HWL_HINSTANCE) were not defined for unknown reasons. Since I don't fully understand vtk's mechanism of not including windows.h when building vtk itself, I just used a big hammer (just defining the symbols on my own).
- Overwriting _WIN32_WINNT caused problems, just removed that.
- Removed an apparently obsolete typedef for 'signed char' that lead to a redefined error.