Commandlet "looks like a commandlet"

I’m trying to run the commandlet located at GitHub - ue4plugins/CommandletPlugin: Unreal Engine 4 plug-in that demonstrates how to implement a commandlet.. To do this I copied it into my project as a new file however when I run the commandlet it always says “HelloWorldCommandlet looked like a commandlet, but we could not find the class.” Any help would be appreciated.

// Copyright 2015 Headcrash Industries LLC. All Rights Reserved.

#pragma once

#include "Commandlets/Commandlet.h"
#include "HelloWorldCommandlet.generated.h"



UCLASS()
class UHelloWorldCommandlet
	: public UCommandlet
{
	GENERATED_BODY()

public:

	/** Default constructor. */
	UHelloWorldCommandlet()
	{
		IsClient = false;
		IsEditor = false;
		IsServer = false;
		LogToConsole = true;
	}

	~UHelloWorldCommandlet()
	{

	}

public:

	//~ UCommandlet interface

	virtual int32 Main(const FString& Params) override
	{
		UE_LOG(LogTemp, Display, TEXT("Hello world!"));

		return 0;
	}
};

What commandline are you using?

I’ve got a .bat

“C:\Program Files\Epic Games\4.12\Engine\Binaries\Win64\UE4Editor-cmd.exe” “C:\Games\ArchV” -run=HelloWorld

that I just run in a standard command prompt on windows 7.

on a second look I wonder if it’s not loading my project so it can’t find the class, however if i change Argv[1] from “C:\Games\ArchV” to “C:\Games\ArchV\ArchV.uproject” it throws an error saying it can’t find the map specified.

A bit of Background: I’m trying to build a script to batch import models that will run on a server. So I assume it has to run through the editor. I am also running unreal off the Epic Games Launcher.

109328-error+message.png

Yeah, I was also thinking it might not be loading your project, and that does seem to be the case.

I tried this myself locally and as long as the .uproject is the first argument, it should be treated as a project rather than a map.

Is your project definitely built for the correct editor config? Bear in mind that without “-debug” on the commandline, it’ll be trying to load the “Development Editor” rather than “Debug Editor”/“DebugGame Editor” build of your game.

Also, just to rule out any bat weirdness, does the same thing happen if you run that command directly in cmd?

I’m relatively new to compiling the C++ in unreal. I just downloaded the launcher from epic games created a new project, added in the file I wrote above and pressed compile. I just tried setting it from development to debug in the editor and that didn’t help. I also tried changing to “DebugGame Editor” in vs2015 and still ran into the same error.

Ended up downloading 4.13 from github and so far it seems to be running fine.

Can i ask how did you slove your problem in the final?I have run the code in ue4.18,but it dosen’t work,still the same problem as above.Thanks a lot!