vtkIOImage conflicts with cmath (math.h)
The issue arises when vtkIOImage is listed as a needed component in find_package(VTK COMPONENTS ...)
. cmake ..
works fine, but make
will spit out the attached error log suggesting that there is some unwanted interaction with cmath
.
Not including cmath
allows the compile run to proceed.
Tested on MacOS 10.14.3, with vtk 8.1.2 installed from Homebrew (and just upgraded this morning).
main.cpp:
#include <cmath>
int main(){
return 1;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.12)
project(main CXX)
find_package(VTK REQUIRED COMPONENTS vtkCommonColor vtkIOImage)
include(${VTK_USE_FILE})
add_executable(main main.cpp)
target_link_libraries(main PUBLIC ${VTK_LIBRARIES})