The first attempt at this was really cool, it worked and I have new blueprint nodes but then I adapted the code a little to add more features and now I’ve started getting this issue, which doesn’t seem like an issue with my code but moreso a dependency being correctly installed? But then again I’m brand new to all this so I don’t know.
So far I’ve verified the engine, cleaned and rebuilt the .sln, tried installing more components, I’ve installed the visual studio development plugin from the marketplace.
I looked back at my original code that worked and it didn’t have the “using UnrealBuildTool;” so maybe I’m not set up for that???
.vs
Right click your uproject file and “Generate Visual Studio project files”.
Run and recompile. (Ok I see you followed those steps)
If you made an empty plugin and started adding code from a tutorial or based on another plugin the maybe the lack of generated files is throwing off the compiler in some way?
You could try installing a newer version of .Net (hard to say if that will influence the compile, I use it in other projects)
Are you building from the source version of the engine or are you using the binary version from the epic launcher?
Make sure your project is set to the default startup project. (it’s name should be in bold letters)
Is your configuration set to “Development Editor”
Do you have any custom settings for code cleanup in VS? Maybe it’s stripping out commands during compile too aggressively?
Tbh ive never tried this before so everything is default settings. Im justing the launchers 5.4 version, trying to do as little as possible in terms of customisation haha
I just create a new c++ project no starter content or anything, then add a new plugin, i choose the blank template, then i fill in the .h, .cpp and .cs files.
I Generate Visual Studio project files, clean and rebuild the .sln and have even tried the whole process from scratch several times
Admittedly my code is helped by chatgpt as ive only learned cpp basics so far and im trying to further my understamfing of the process to implement it in unreal (im worried about actually using cpp in a real project for this exact non compiling reason so i thought id make a plugin.
The plugin idea was to create a few blueprint nodes to generate and validate licence codes for an application, that worked and then i tried to make it better by adding a few more features anyway i can add the code below in case its a problem in it but im not sure that there is. Its set to development mode and ive got no custom settings. Im using vs 2022.
Maybe you could recommend a good way/resource to learn c++ for unreal engine or more specifically making blueprint nodes from c++ code
public class LicenseManager : ModuleRules
{
public LicenseManager(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"HTTP", // Ensure this is added for HTTP requests
"Json", // JSON handling
"JsonUtilities" // JSON utilities
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
}
);
}
}
.h file
#pragma once
include “CoreMinimal.h” include “Kismet/BlueprintFunctionLibrary.h” include “LicenseManager.generated.h”
UCLASS()
class LICENSEMANAGER_API ULicenseManager : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
include “LicenseManager.h” include “Misc/Guid.h” include “Misc/SecureHash.h” include “HttpModule.h” include “Interfaces/IHttpRequest.h” include “Interfaces/IHttpResponse.h”
The parts that rely on HTTP were pointing to the wrong header paths. (all I* files are in the folder interfaces)
The plugin structure also didn’t adhere to the normal module version of plugins with their startup and shut down phases (it isolates the plugin to it’s own module)
Here is a version that compiles fine, just add the json elements into the plugin build file (I just wanted to see if I can get it to compile and run)
You know what, I had just started over again and instead of choosing a blank plugin template I chose a blueprint function library template and it has the same structure you used, so for my own sanity ive gone over the plugin you got to work and my fresh one side by side until they are the same.
I’m going to save all, clean the solution and then build…
Edit: Unsuccessful, that’s a pity. You’re experience really shows here that you got it to work
I’m thinking this is a me problem at this stage in terms of how my visual studio is set up
Also, if it means anything useful, I can’t even open your project (clean download) (scratch that, for once clicking yes actually works and it rebuilds successfully)
In any case, you’ve been really helpful/ I clearly need to enroll in a course to understand the process for working with c++ in Unreal, it’s a totally different ball game from blueprint only
what do you know… rebuild = no errors! amazing. That’s crazy, i wonder if doing that fixes my own
5th attempt
Edit: no my own attempt doesn’t open any more and can’t be built.
Edit: I went through my project, replaced all my code with yours in each file. rebuilt and it works. It literally must have been something in the way it was written or spaced out maybe. I’m going to undo the fix and compare both sets of code to work out what it was.