Issues with Unreal ensure() and check() macros
There is a set of macros in Unreal that provide a function much like and assert but integrate into the logging. The two big ones are "ensure()" and "check()". It gives me red squiggles and an error "cannot resolve symbol '__nop'" and asks if I would like to create a global function with that name.
Everything compiles fine, there isn't an actual error, but this false positive means I need to ignore some red errors and that could be a problem in the long run. Is there anything on my end I can do tell ReSharper that it can ignore this particular macro?
Please sign in to leave a comment.
If you've updated Visual Studio or Unreal Engine recently, try regenerating Unreal project files, clearing ReSharper caches (on the ReSharper | Options | Environment | General) page, and reopening the solution.
Hello, sorry for the late reply (vacation). I neither update Visual Studio or the Unreal Engine, but I have done both of those things and it didn't help.
What happens when you include <intrin.h> (where __nop is defined) directly, can ReSharper resolve the include? If not, are the include paths reported by ReSharper correct?
I added "#include <intrin.h>" in WindowsPlatform.h where the __nop is used and the error squiggle remains. How do I check the include paths reported by ReSharper?
I can follow the include path manually and I'm pretty sure it goes "Engine.h" > "Core.h" > "CoreMinimal.h" > "CoreTypes.h" > "HAL/Platform.h" > and then lastly through a macro #include COMPILED_PLATFORM_HEADER(Platform.h) which results in "WindowsPlatform.h"
Just try adding #include <intrin.h> to a .cpp file and check if __nop can be resoled from the same file. If R++ can't find <intrin.h>, the include directive will be red and the tooltip will contain include search paths.
Ok, I put it in the cpp file and the include directive was red. Not sure how to get the other 698 search paths.
The system include paths come from <IncludePath> in your game .vcxproj file. Could you please check it contains the correct path to your VS installation (e.g. something like C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29304\INCLUDE) and that intrin.h exists at this location?