Hi again @Rajeev Arora ,
Thank you for providing your ioc file, it helped me to reproduce the problem.
Actually, it's a normal behavior, in fact, when USE_NEWLIB_REENTRANT is enabled when using Keil or IAR toolchain, CubeMx project compilation will fail : "cannot open source file "reent.h".
For that, the USE_NEWLIB_REENTRANT parameter must be Disabled with EWARM OR MDK-ARM.
(There's a warning when you generate your project, mentioning the information)
Hope my answer helped you :)
Khouloud