[UPDATE]
So, after going through all of my files, I did find one preprocessor include directive that referenced “Blueprint.h”. I removed it, but am still getting errors, although different. The project still compiles successfully with Editor build configurations.
New Error: LNK1181: cannot open input file 'C:\Program Files\Epic Games\UE_4.15\Engine\Binaries\Win64\UE4-UMGEditor.lib'
Any advice would be appreciated.
ORIGINAL ISSUE:
Error: C1083 Cannot open include file: ‘WidgetBlueprint.generated.h’: No such file or directory
So this is kind of a weird one for me. I’ve experienced similar issues like this before, but this time I have a large project relying on it, so I can’t exactly rebuild the project to get around this issue. I’m hoping someone can help me with this issue.
Everything works great if I build the project with the Editor, but get this error when trying to package or build without the editor.
Build Configurations that work: Debug Game Editor, Development Editor
Build Configurations that cause errors: Debug Game, Development, Shipping
My Project Build.cs file:
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
public class Project : ModuleRules
{
public Project(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "MySQL", "UMG", "UMGEditor", "Slate", "SlateCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
// 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
}
}
I believe I have all the necessary modules needed to use UMG. I have created an extended UserWidget C++ class that doesn’t inherit from WidgetBlueprint.h, but rather from UserWidget.h as should.
Extended Widget Blueprint class that I build:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Blueprint/UserWidget.h"
#include "MySQLEngine.h"
#include "Project_WindowsOS.h"
#include "Project_ExtendedWidgetBlueprint.generated.h"
/**
*
*/
UENUM(BlueprintType)
enum class EPaginationArrowDirection : uint8
{
NONE UMETA(DisplayName="None"),
ARROW_LEFT UMETA(DisplayName="Left Arrow"),
ARROW_RIGHT UMETA(DisplayName="Right Arrow")
};
UCLASS()
class PROJECTDEV_API UProject_ExtendedWidgetBlueprint : public UUserWidget
{
GENERATED_BODY()
MySQLEngine sqlInterface;
public:
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Custom)
FString MachineName;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Custom)
FString StationName;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Custom)
TArray<FString> AllListedMachines;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Custom|Pagination")
EPaginationArrowDirection PaginationArrowDirection;
UFUNCTION(BlueprintCallable, Category = Custom)
FString GetMachineName();
UFUNCTION(BlueprintCallable, Category = Custom)
TArray<FString> GetAllSimulatorMachines();
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Custom|Pagination")
void DeactivateAllPaginations();
};
Maybe I’m just missing something, but it doesn’t make sense to me why my project compiles for Editor builds, but won’t package or work with any other builds. Any help would be most grateful. Thank you in advanced!