Opencv basic_string heap corruption

Hi, I am working on a game that uses facial landmark detection. I am using Opencv 4.5.5 and UE4.20. I am able to run facial detection using the opencv library but when trying the facial landmark detection, I get a heap corruption at facemark->loadModel(filename). I have been able to figure out that this may be due to the string class being different from the UE4 string. But compiling the opencv library with clang 5.0.0 (the toolchain for UE4.20) does not resolve the error.

Note: the program runs fine when I continue execution despite the heap corruption, that is it does not break and the model loads.

Is there any workaround to resolve the dll compilation with ue4? thanks.

Hi, Have you found the solution to the problem yet? The same problem happened to me.
Thank for your reply.