Closed realasking closed 3 years ago
error LNK2038: mismatch detected for '_CRT_STDIO_ISO_WIDE_SPECIFIERS': value '0' doesn't match value '1'
And, please provide the full logs.
Thanks.
This seems to be caused by the port mathgl
trying to change the _CRT_STDIO_ISO_WIDE_SPECIFIERS
setting:
# msvc fwprintf print char* for the specifier of "%s" format
if(MSVC AND MSVC_VERSION GREATER 1899)
SET(CMAKE_CXX_FLAGS "/EHsc -D ${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "-D_CRT_STDIO_ISO_WIDE_SPECIFIERS ${CMAKE_C_FLAGS}")
endif(MSVC AND MSVC_VERSION GREATER 1899)
which it relies on, in for example buildtrees\mathgl\src\e47fc8171c-45e0c002a6.clean\src\export_2d.cpp
:
fwprintf(fp,L"\\draw[%s] (%.4g,%.4g) node[rotate=%.2g]{$%ls$};\n", ss.c_str(),x-dx,y-dy, -q.p, t.text.c_str());
notably, without the setting, the %s interprets ss.c_str() as a wide character string, likely corrupting memory.
I don't see how this port can ever be installed with other ports. It's trying to change a global setting. Unfortunately I also don't see a completely portable fix, other than possibly changing mathgl to never use fwprintf
or other wide printing functions, but that might have other bad effects.
I will report this issue to the upstream.
Please track issue #12670.
Host Environment
To Reproduce Steps to reproduce the behavior:
./vcpkg install mathgl:x64-windows-static mathgl[gif,gsl,hdf5,jpeg,png,glut,zlib,qt5]:x64-windows-static
Failure logs message:
Log: