Creating Texture2D in cpp blueprint library unable to relaunch UE5.0

I have tried everything I know and searched forums and even tried Chat GPT for answers but nothing seems to work. Essentially, The moment I create a cpp library for visual studio 2022 or 2019, I open the code and get hit with 56 errors or more. I try rebuilding the solution and the errors still remain. Nothing works. I deleted the entire project and recreated a new one to replicate the bug. I enabled all live coding and visual studio 2019 the first time and 2022 the second time. The moment I create a blueprint library in cpp it is unable to recompile and unable to launch because the solution does not exist. The only action I take is create new project> enable visual studio/live coding> create cpp blueprint in this case Texture2d>open visual studio. UE5 closed> Build code from source> 56 compiler errors>unable to launch editor because of compiler errors. I then follow deleting intermediate and binary files and generating files or other online solutions with fail. I also tried following the errors but those fail as well. There is one file unable to compile properly it has 2 errors called: UnrealType.h with errors on COREUOBJECT_API DECLARE_LOG_CATEGORY_EXTERN(LogType, Log, All); and static_assert(sizeof(FScriptArray) == sizeof(FFreezableScriptArray) && alignof(FScriptArray) == alignof(FFreezableScriptArray), “FScriptArray and FFreezableScriptArray are expected to be layout-compatible”);

I found if you include any files related to windows.h from sockets to even gdi you will be unable to build at all You will get linker errors. I have tried to link manually but all attempts were unrecognized by ue5 or resulted in more errors. I also tried bitmapping image files to a texture2d which required the win32 library and further caused linker errors. I really wanted to use UE5 for my project but not being able to access windows.h function in Cpp is paralyzing.