Example Image2.cxx crash on Windows

Dear all,

I am currently facing a great issue using OTB as a library on windows 10 64 bit.
I would like to open an image file using ImageFileReader.
However my progrem crashes when reading the filename.

To be sure it does not come from my code or library or anything else, I tried to build and launch the example file Image2.cxx where it consists of reading an image file, in a similar way to my program.
And it crashes, exactly at the same spot : line 78, " reader->SetFileName(filename);" (std::bad_alloc)

I have used MSVC 2017 and 2019, the OTB 7.1 and 7.2 libraries. Former version of OTB crash at a different place. I have also tried with the superbuild_install, the last one, and I have the same result.
On a clean windows 10 virtual machine, I have the same trouble.
And I tried MinGW compiler but the example program is not even building with it.