I’m struggling to get my plugin working. I am using windows.h functionality to check if a program is still running in the background. It works like a charm in the editor! But as soon as I try to package to a Plugin it all falls apart, because it somehow can’t find Windows.h. I looked at the internet for answers but all provided don’t work.
How do I include Windows.h when I want to package it as a Plugin?
// Fill out your copyright notice in the Description page of Project Settings.
class BATCHBUILDER_API UBatchBuilderFunctionLibrary : public UBlueprintFunctionLibrary
UFUNCTION(BlueprintCallable) static void WriteBuildFile(FString QualityInput, FString Level); UFUNCTION(BlueprintCallable) static void ExecuteBatchBuilderBat(); UFUNCTION(BlueprintCallable) static void PrintTestINT(int& OutInt); UFUNCTION(BlueprintCallable) static void PrintTestString(FString& OutString, bool& DebugBool); UFUNCTION(BlueprintCallable) static void IsRunningB(bool& Boolean); UFUNCTION(BlueprintPure, Category = "FPS Game CPP Nodes", meta = (Keywords = "Load Text File")) static bool LoadTxt(FString FileName, FString& SaveText); UFUNCTION(BlueprintCallable, Category = "FPS Game CPP Nodes", meta = (Keywords = "Save Text File")) static bool SaveTxt(FString SaveText, FString FileName);
It succesfully compiles, but when packaging it gives the following error:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um\Windows.h(1,10): fatal error: ‘winapifamily.h’ file not found
At first this was Windows.h which was missing, but after modifying it with multiple different sollutions from the internet it just moves the problem to the next include in line untill it gets so many errors from all the includes that it fails to show the errors.