error: LNK2038: Mismatch detected for 'boost_type_index_abi': value RTTI is used No match value RTTI is off

UE4 under windows reference boost header file error reporting problem

1. Quoting an official statement from Microsoft

When /GR is turned on, the compiler defines the _CPPRTII preprocessor macro. /GR is turned on by default. /GR - Disable runtime type information.
Use /GR if the compiler cannot statically resolve object types in your code. However, /GR will increase the size of the .rdata part of the image. If dynamic_cast and typeid are not used in the code, then /GR does not need to be used, which can reduce the program size.

2.Solution

Open vs Properties->c/c++->Language->Enable runtime type information selection (no/GR-)
Insert image description here

3.Solution under Linux: Modify CMakeList.txt

add_compile_option(-fno-rtii)
disable RTII

Author: Feima Programmer.
Welcome to technical exchange: QQ: 255895056.
Please indicate the source for reprinting. If there is any inappropriateness, please correct me.

Guess you like

Origin blog.csdn.net/haohaohaihuai/article/details/120028086