Visual Studio Error: Cannot open source file "ProceduralMeshComponent.h"

For some reason I’m getting this error when trying to include ProceduralMeshComponent.h.

Here is my Build.cs file. Any ideas?

using UnrealBuildTool;

public class MyProject3 : ModuleRules
{
	public MyProject3(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ProceduralMeshComponent" });

		PrivateDependencyModuleNames.AddRange(new string[] { "ProceduralMeshComponent" });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");

		// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
	}
}
1 Like

Hello Wilberolive,

From looking up a wiki post for using ProceduralMeshComponent in C++, it seems that you need to run Generate Project Files from right-clicking the project’s .uproject file after adding this declaration so that Visual Studio can detect that you are looking to add that module.

You can find more information here: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

1 Like

Sorry for the late repsonse but. When I right click on my .uproject I don’t have an option to re-generate files

Hello JamesSwann95,

This is likely related to your .uproject files not being associated with the correct program. Do you get any other UE4 specific options when you right-click your .uproject such as Launch Game? If the file association is not correct, one of the solutions posted here should be able to assist you.

Worked perfectly