I finally found the bug. Just as @Botje said, it's because of the mixture of release/debug mode of DLLs, but in a different way.
When building Skia
with the is_debug_build=true
arg, I guess it's actually built in Release with Debug Info mode. A friend told me that in windows MSVC runtime library, the std library classes may contain some member variables for Debug mode, but not for Release with Debug Info mode. This may bring the inconsistency of std classes between the skia dll and my project.
To address this issue, I set the cmake setting set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
to force the compiler to use MD
instead of MDd
. And this may link the specific MSVC runtime library version without debug member variables to keep the consistency.