[vtk-developers] Build error with current release and git on Arch Linux 64-bit

Oon-Ee Ng ngoonee.talk at gmail.com
Thu Jan 8 16:55:50 EST 2015


Yesterday I sent a mail to vtk-users, but in the meantime I've 'solved' it.

Summary:- vtk not compiling for me due to the error(s) in [1].

Errors indicate that std::min and std::max cannot deal with having
differing types (specifically, you can't min(uint, int) or max(int,
uint)).

The file involved is in Rendering/FreeType/vtkFreeTypeTools.cxx

Based on current release (not sure whether git has any newer edits,
does not seem so), the affected code was committed in Nov 15 2012,
commit 6dd7b574d7594319e764fea4d336adf85a71d8ab).

Anyway, the changes I had to make were to lines 1189, 1954, and 1955,
pasting them here as I'm no git-guru and tend to generate malformed
patches. The changes are really easy anyway, and someone should verify
that I'm not just ignoring the problem:-

1189
      metaData.descent = std::min(-((int)(bitmap->rows) -
(bitmapGlyph->top - 1)),
1954 and 1955
      bbox[1] = std::max(bbox[1], pen[0] + bitmapGlyph->left +
(int)(bitmap->width));
      bbox[2] = std::min(bbox[2], pen[1] + bitmapGlyph->top - 1 -
(int)(bitmap->rows));

Hope this helps. I'm surprised I'm only now running into this problem,
but just glad to be able to recompile vtk for qt5 support for my
project.

[1] - http://pastebin.com/t8Tu74pV


More information about the vtk-developers mailing list