Compiling fails as soon as I add a second UCLASS!?

anonymous_user_d7cbf4ea
Fri, 29 Jul 2016 20:29:11 +0000
Plugins

Hello I started to develop an Artnet Plugin. Sending the packages works fine now. But when I wanted to programm a udp Receiver I ran in to some strange compiling errors. I’m using Visual Studio Community 2015.

I created the plugin in the unreal engine via going to plugins-> new plugin → Blueprint library

my ArtNet.build.cs looks like this:

using UnrealBuildTool;

public class ArtNet : ModuleRules
{
	public ArtNet(TargetInfo Target)
	{

		PublicIncludePaths.AddRange(
			new string[] {
				"ArtNet/Public"

				// ... add public include paths required here ...
			}
			);


		PrivateIncludePaths.AddRange(
			new string[] {
				"ArtNet/Private",

				// ... add other private include paths required here ...
			}
			);


		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				"Sockets",
				"Networking"

				// ... add other public dependencies that you statically link with here ...
			}
			);


		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"CoreUObject",
				"Engine",
				"Slate",
				"SlateCore",

				// ... add private dependencies that you statically link with here ...
			}
			);


		DynamicallyLoadedModuleNames.AddRange(
			new string[]
			{
				// ... add any modules that your module loads dynamically here ...
			}
			);
	}
}

So in the “public” folder ther is my “ArtNetBPLibrary.h”. It looks like this:

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "Engine.h"
#include "ArtNetBPLibrary.generated.h"


UCLASS()
class UArtNetBPLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_UCLASS_BODY()

	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Setup ArtNet-UDP-Networking", Keywords = "ArtNet initialize dmx"), Category = "ArtNet")
	static void SetupArtNetUDPNetworking(const FString& DestinationIP = "192.168.0.1", const int32 DestinationPort = 6454, const int32 SourcePort = 6454);

	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Set ArtNet-DMX-Package-Routing", Keywords = "ArtNet header set dmx"), Category = "ArtNet")
	static void SetArtNetRouting(int net = 0, int subnet = 0, int universe = 0);

	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Set DMX Channel", Keywords = "ArtNet DMX channel set"), Category = "ArtNet")
	static void SetDmxChannel(int channel = 1, int value = 0, bool valueInPercent = true);

	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Set all DMX Channels", Keywords = "ArtNet DMX channels set all"), Category = "ArtNet")
	static void SetAllDmxChannels(int value = 0, bool valueInPercent = true);

	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Send ArtNet-DMX-Package", Keywords = "ArtNet DMX send"), Category = "ArtNet")
	static void SendArtNetDMXPackage(bool useSequencing = true);

};

Everything works fine until here. It compiles and my blueprints work inside of Unreal. But when I add another declaration to the file it doesn’t compile anymore. For example when I add this right below the code:

UCLASS()
class ArtNetUDPReceiver : public UBlueprintFunctionLibrary
{
	GENERATED_UCLASS_BODY()
};

or the exact same error, when I add a Ustruct instead:

USTRUCT(BlueprintType)
struct ArtNetDMXData
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ArtNetProp")
	int Squence = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ArtNetProp")
	int Net = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ArtNetProp")
	int Subnet = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ArtNetProp")
	int Universe = 0;

	ArtNetDMXData()
	{}
};

Unfortunately the error message is in german and I can’t get my visual studio to report the errors in english!
It says: “Diese Deklaration hat keine Speicherklasse oder keinen Typspezifizierer”

Any ideas on what I’m doing wrong?
I also tried to make a new file for the “ArtNetUDPReceiver”, but in this .h file it was exactly the same…

Any help is highly appreciated! Thanks in Advance,
Johannes

6 posts - 1 participant