I’m trying to follow the flight path tutorial Build a Flight Tracker with Cesium for Unreal – Cesium
I’m up to editing the build.cs file.
But when I compile I get the error:
Expecting to find a type to be declared in a target rules named ‘MapsEditorTarget’. This type must derive from the ‘TargetRules’ type defined by Unreal Build Tool.
Setting up bundled DotNet SDK
/Volumes/My Passport/Epic Games/UE_5.3/Engine/Build/BatchFiles/Mac/…/…/…/Binaries/ThirdParty/DotNet/6.0.302/mac-arm64
Running dotnet Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll -ModuleWithSuffix=Maps,0442 MapsEditor Mac Development -Project=/Volumes/My Passport/Maps/Maps/Maps.uproject /Volumes/My Passport/Maps/Maps/Maps.uproject -architecture=arm64 -IgnoreJunk
Log file: /Users/username/Library/Application Support/Epic/UnrealBuildTool/Log.txt
Invalidating makefile for MapsEditor (Maps.Build.cs modified)
Errors generated while parsing ‘/Volumes/My Passport/Maps/Maps/Source/Maps/._Maps.Build.cs’
/Volumes/My Passport/Maps/Maps/Source/Maps/._Maps.Build.cs(1,1): error CS1056: Unexpected character '/Volumes/My Passport/Maps/Maps/Source/Maps/._Maps.Build.cs(1,47): error CS1056: Unexpected character 'Total execution time: 1.16 seconds
Additional information, I’m on a Mac. I tried installing visual studio, but there’s no option for C++
What do we do if we’re on Mac? Is that an issue? I have XCode installed.
It sounds like the Unreal Build Tool doesn’t like the contents of your _Maps.Build.cs
file. It’s hard to say why without seeing it. That’s also kind of a strange filename, so I’m not sure what to make of it.
Unfortunately I don’t have a Mac and don’t have any first-hand experience trying to set up a new Unreal C++ project on one. I suspect you can find plenty of tutorials on the subject online, though.
Maps.build.cs looks like this:
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
public class Maps : ModuleRules
{
public Maps(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
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
// Add Cesium for Unreal plugin dependency path
PrivateDependencyModuleNames.AddRange(new string[] { "CesiumRuntime" });
// Tell Unreal Engine to use C++17
CppStandard = CppStandardVersion.Cpp17;
}
}
File structure looks like this
The C++ should compile fine through XCode
Nothing jumps out at me in your Build.cs file. The error seems to indicate that there’s an Unexpected character '
at line 1, column 1 in that file, but I don’t see it. I tried Googling it, and this looks relevant (especially the last posts at the bottom, which you may have to expand):
https://www.reddit.com/r/unrealengine/comments/123ghga/problem_with_compiling_c_on_mac_xcode_142/
Thanks a lot for the answer. Luckily I had already solved it by moving the project to the Mac SSD, so it no longer gave me any problems. Thanks a lot all the same
Thanks Kevin,
I was able to sort the compile error, but now the spline doesn’t show nor does the animation work despite everything else seeming correct. Screenshots here: Flight Tracker Tutorial - Spline not showing