MonoUE - C# and F# for UE4

OMG… I was sooo excited to see a UE4 mono build… was hoping to get started on my Mac but I can’t seem to build.

Everything looks fine until is get to the mono stuff in the build… Get a bunch of errors about it can’t find the namespace (List in post above)…

Even though I extracted the dependencies… so there is a folder called ThirdParty and under that mono…

Has ANYBODY got this to build on a Mac ???

YO @mhutch … is seems like the build is looking for a header file <mono/metadata/class.h>

I don’t have a metadata folder in my mono folder from the in the ‘MonoUEDependencies-c8df6088.zip’ that was in the post to download…

Is the dependencies MISSING the ‘mono/metadata’ metadata folder

Showing Recent Issues
In file included from /Users/Shared/UnrealEngine/Install/MONO_4.16/Engine/Plugins/MonoUE/Intermediate/Build/Mac/UE4Editor/Development/MonoRuntime/Module.MonoRuntime.cpp:2:

In file included from /Users/Shared/UnrealEngine/Install/MONO_4.16/Engine/Plugins/MonoUE/Source/MonoRuntime/Private/MonoAssemblyMetadata.cpp:4:

/Users/Shared/UnrealEngine/Install/MONO_4.16/Engine/Plugins/MonoUE/Source/MonoRuntime/Private/MonoAssemblyMetadata.h:9:10: fatal error: ‘mono/metadata/class.h’ file not found

#include <mono/metadata/class.h>

@MackeyK24 I had that error at the beginning. The error is from not having MonoUEDependencies. Where did you extract the files to? What does your UnrealEngine\Engine\Plugins\MonoUE folder looks like?

You have to extract the content of MonoUEDependencies into the UnrealEngine\Engine\Plugins\MonoUE folder. You have to do a full rebuild if the build process fail once. The metadata full path is UnrealEngine\Engine\Plugins\MonoUE\ThirdParty\mono\include\mono-2.0\mono. If you extract the content correctly, then it should just work, but I don’t have a Mac so who knows.

Yo @kelfire … thanks for the info… I am going to start all over again… This SCREWUP was ALL ME…

I put the extracted depends in wrong folder…

I am going to download everything all over again and try again…

Again… THANKS FOR THE INFO :slight_smile:

Just a suggestion… Maybe change that section that says

Before building the engine, download MonoUEDependencies-c8df6088.zip and extract it into this directory. This contains binaries of the Mono runtime and class libraries, and data files for the project templates.

TO

Before building the engine, download MonoUEDependencies-c8df6088.zip and extract it into the ‘UnrealEngine\Engine\Plugins\MonoUE’ directory. This contains binaries of the Mono runtime and class libraries, and data files for the project templates.

Just to be a little more clear about exactly where they should go

:slight_smile:

[COLOR=#333333][COLOR=#333333]@[/COLOR][/COLOR]mhutch

I am currently trying to rewrite some of the Unreal templates to test the plugins, and I got a couple of question on how much of the Unreal Framework is implemented in C#.

  1. Is TSubclass<> supported inside of C#? I wrote very simple test case and an error pop up. Seems like I am not able to access any method/function from the parent class. In C++, I should be able to access targetMyActor.HelloWorld(). Is there a way to access functions or variable from a Subclass inside of C#?

  2. **Error **


Error	CS1061	'SubclassOf<MyActor>' does not contain a definition for 'HelloWorld' and no extension method 'HelloWorld' accepting a first argument of type 'SubclassOf<MyActor>' could be found (are you missing a using directive or an assembly reference.

  1. **Code **

class MyActor : Actor	{
		protected MyActor(ObjectInitializer initializer) : base (initializer)
		{
		}


		protected MyActor(IntPtr nativeObject) : base (nativeObject)
		{
		}


		public void HelloWorld()
		{
		}
	}


	class TestCharacter : Character
	{
		[UProperty, BlueprintVisible, EditorVisible]
		[Category("HelloWorld")]
		public SubclassOf<MyActor> targetMyActor { get; set; }


		protected TestCharacter(ObjectInitializer initializer) : base (initializer)
		{
		}


		protected TestCharacter(IntPtr nativeObject) : base (nativeObject)
		{
		}


		public void ExecuteHelloWorld()
		{
			targetMyActor.HelloWorld();
		}
	}

  1. How are UInterface supported inside of C#? I try defining a custom UInterface, but it gave me an error. I sidestep this issue by using the regular C# interface, but it would be good to know an official answer.

  2. **Error **


Class 'CS_FirstPersonMono.MyTestInterface' is invalid because 'UnrealEngine.CoreUObject.Interface' may not be derived from in managed code.

  1. **Code **

 class MyTestInterface : Interface	{
		protected MyTestInterface(ObjectInitializer initializer) : base (initializer)
		{
		}


		protected MyTestInterface(IntPtr nativeObject) : base (nativeObject)
		{
		}
	}

  1. Is it possible to write Editor extension from C# like adding new windows or buttons to the Editor?
  2. Is Unreal Multicast Delegate supported? If it is what is the syntax to create one i.e. bind, call, remove?

Yo @kelfire thanks… that fixed that problem… but still get an error when building… This time:

Showing Recent Issues
System.ComponentModel.Win32Exception: ApplicationName=’/Users/Shared/UnrealEngine/Install/MONO_4.16/Plugins/MonoUE/MSBuild/mac-msbuild.sh’, CommandLine=’ /t:Restore /property:Configuration=“Development Editor” /property:Platform=“Mac” /nologo /verbosity:minimal “/Users/Shared/UnrealEngine/Install/MONO_4.16/Engine/Plugins/MonoUE/Intermediate/Build/Mac/Mono/UE4_Bindings.sln”’, CurrentDirectory=’/Users/Shared/UnrealEngine/Install/MONO_4.16/Engine/Source’, Native error= Cannot find the specified file

But the path is wrong: /Users/Shared/UnrealEngine/Install/MONO_4.16/Plugins/MonoUE/MSBuild/mac-msbuild.sh

it should be /Users/Shared/UnrealEngine/Install/MONO_4.16/Engine/Plugins/MonoUE/MSBuild/mac-msbuild.sh

is missing ‘Engine’ in between MONO_4.16 and Plugins…

Does the source have to be certain root folder name… Mine is call MONO_4.16 instead of just UnrealEngine ???

Sorry to ask this question again… but has ANYBODY got this to build on a Mac ???

Me again… I think the MonoUE.Plugin.cs is wrong: is is now
DirectoryReference MonoUEDirectory { get { return DirectoryReference.Combine(RootDirectory, “Plugins”, “MonoUE”); } }

If the RootDirectory is main ‘UnrealEngine’ folder which has ‘Engine’ under that folder… Then is should be this

DirectoryReference MonoUEDirectory { get { return DirectoryReference.Combine(RootDirectory, “Engine”, “Plugins”, “MonoUE”); } }

Right ???

Trying it now, but it takes FOREVER to build the main UE4 on my Mac

Man… I might try have to find a windows machine… Gonna cost me after I spent ALL this money on My Mac Pro…
But I assume all ‘real’ development being done with MonoUE is on Windows…

I am so excited to try out… Has anyone FOR SURE got this project to build on Windows (Since I hear nothing for Mac)

I just wanna know BEFORE I run into town in the morning and BUY a windows machine.

I would not rush and buy a PC just because current problems with MonoUE. It should currently be considered a beta and will probably improve quickly. Apart from stability there are still crucial festures missing.

(Also, installing Windows on a separate partition sounds like a better option than buying another computer.)

Hey @HavocX … Morning :slight_smile:

I should say that i was considering getting a windows machine for another reason as well… maybe the biggest reason… VIDEO CARDS

Mac version of the higher end Video Cards ARE REALLY expensive and are you have a VERY LIMITED choice of cards and they ONLY work with certain models…

That makes me miss the old school ATX clone days… You run down to Fry’s Electronics and grape a case, motherboard, cpu, ram, hard disk and pretty much ANY video card in the world :slight_smile:

Right now I am rocking a GTX 770 … Works good but not the best.

With all that being said… I would REALLY like to get this going on my MAC … That my main workstation (as well as all my other devices and work places in my house… all Apple stuff for me)

Yeah building the from source takes a longgg time. I was averaging 2-3 hours per build (I am using a hard drive). Took me 6 tries to build this plugin successfully, so yeah took a lot of time.

Not sure what is going on here?

@honaj The MonoUE automation is broken (you can’t package/cook your project yet). You can still build the game engine + plugin without building the Automation tool.

Ah, thanks, I just assumed that a screen full of errors meant that build failed. Is there any kind of documentation anywhere? I can’t even figure out how to create a new class.

That’s an excellent suggestion, thanks. Done!

I hope eventually to have the build automatically download and unpack these bits, just like the engine dependencies.

I’d probably consider it an alpha, tbh :slight_smile:

Although Mac is supported, I do most of my plugin dev on Windows, so the Windows build will likely be more stable in the near term simply because I’m dogfooding it more.

Yes, UnrealEngine.Runtime.SubclassOf<T>

We don’t support UInterfaces yet. Is there a specific use case you have in mind?

Not currently. Pretty much all types and members in the unreal type system (UClasses/UProperties etc) are bound automatically via UHT reflection, but anything else would need to be bound manually or using a tool like CppSharp. I’d like to look into enabling editor plugin scenarios at some point but that’s a ways off. Lots of other things to do first!

Not automatically, though we hand-bound a few for the editor agent.

Are there specific ones you want to use? We can probably automate this, it just wasn’t high on the priority list.

Hi mhutch!

I was able to build (on 1st try, no problems) and to create the C# only third person project template.

But I can’t see how to compile the code.

I tried to generate visual studio files but I got:


Running E:/Github/MonoUE/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="E:/UnrealProjects/CSharpTest/CSharpTest.uproject" -game -engine -progress
Discovering modules, targets and source code for project...
UnrealBuildTool Exception: ERROR: Could not find MonoGenerateProjects executable at path 'E:\Github\MonoUE\Plugins\MonoUE\Binaries\DotNET\MonoGenerateProjects.exe'

Which is missing the Engine folder… it should be: ‘E:\Github\MonoUE\Engine\Plugins\MonoUE\Binaries\DotNET\MonoGenerateProjects.exe’