Errors- Visual Studio

I have many C++ classes in a project that I am working on, and I have a mass of errors as follows:

In other words, the errors are by an overwhelming majority of the same type, complaining about not being able to find the particular source file in the title. There are some subsequent errors that appear to be a result of the question asked herein, such as the following:

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "CharacterSkill.generated.h"

UCLASS()
// On UCharacterSkill declaration, declaration is incompatible with "int UCharacterSkill()"
class PROJECTNAME_API UCharacterSkill : public UObject
{
	GENERATED_BODY()
        //...
        // Constructor
        UCharacterSkill(); // explicit type is missing ('int' is assumed)
}

I have tried deleting my .vs, Intermediate, and Saved directories and .sln file followed by regenerating my VS files by right-clicking on my .uproject. I have also checked for typos in my UFUNCTION() macro parameters and have deleted all potentially problematic meta parameters therein. Are there any additional solutions to this kind of problem?

1 Like

You are not the only one with this problem I will tell you that. I also have the same problem on UE4.26

1 Like

I’m having the same problem with UE4.26.1 with Visual Studio version 16.8.5. I haven’t been able to find any solution for this issue, so I reported it to Epic (I’ll post a link to the relevant page in the issues tracker once I can see it there).

1 Like

I also sent a report myself.

1 Like

This looks like your macros are not getting expanded for some reason. It should expand to something like Windows/WindowsCriticalSection.h

Can you show us your CriticalSection.h file? When you hover over the macro, does it expand to the above path?

same problem here, been trying to fix it for hours

1 Like

I’ve experienced this issue several times, but when it happens my code usually compiles just fine (unless there’s an unrelated error in my code). It’s probably best to just ignore those error messages (as annoying as they are) and let them disappear on their own (which to me they usually do).

I’m having this issue as well, and my code will not compile. :expressionless:

1 Like

Same here 4.26.2 source

1 Like

Same here with 4.27.1

1 Like
  1. Go to your Project folder.
  2. Delete Intermediate/Saved/Binaries folders
  3. Right-click the project file.
  4. Click “Generate Visual Studio project files”
  5. Wait.
  6. Open Visual Studio Project again.

Thanks to this link: include - UE4 - Visual Studio cannot open any source file after I add new c++ files from Editor - UBT_COMPILED_PLATFORM error - Stack Overflow

3 Likes