@Wallenstein thank you for your contribution.
I resolved the issue with my code, so I will describe here what I did.
The -Yu flag problem occurred because I recompiled my static library on VS2019 and apparently, the settings wasn’t the same. I had to turn off the pre-compiled headers when compiling my static library and the error went off.
It wasn’t the end of my problems. A new error occurred, which was something like:
Error 815 error C1900: Il mismatch between 'P1' version '20100826' and 'P2' version '20080116'
Error 816 error LNK1257: code generation failed
You can read about this error online, but it more or less about differences in saved parsed code (P1) in file vs generated code (P2).
I updated VS2019 to the newest version but it didn’t help. I compiled my static library and my UE4 project with same version of VS2019, so it was kinda confusing.
SOLUTION: I created a new blueprint project in UE4 editor and changed Edit->Editor Preferences->General->Source Code->Source Code Editor to Visual Studio 2019. Then I regenerated my main focus project’s solution and recompiled.
Good luck!