VTK Array doesn't work correctly if it's used under Unreal Engine

I have resolved this problem, the root cause camed from ABI mismatch for VTK and Unreal side.
ABI mismatching comes from that both use each different standard C++ runtime. Contrary to me confirmed, VTK used GNU libstdc++ and Unreal does clang’s default libc++.
Finally, I built VTK again to be bound with the libc++ by using Unreal’s clang toolchain.
I specify -stdlib=libc++ to CMake variables below.

CMAKE_CXX_FLAGS=-stdlib=libc++
CMAKE_EXE_LINKER_FLAGS=-stdlib=libc++
CMAKE_SHARED_LINKER_FLAGS=-stdlib=libc++
1 Like