Here is what I did:
I copied the Optitrack folder in plugin, I started my project and the plugin shows. I tried to check them both but on restart I get the “Engine module cannot be compiled at Runtime. Please build through your IDE”.
So, I followed the following to recompile (My project was Blueprint based only) How to Convert a Blueprint Only Project to a C++ Project (using Windows)
It builds fine if the Optitrack plugins are disabled, but once I enable then I get this message upon restart:
“The following modules are missing or built with a different engine version:
OptitrackLiveLink
OptitrackNetnat
Engine modules cannot be compiled at runtime. Please build through your IDE”
But as soon as I hit BUILD I get the error message:
1>Expecting to find a type to be declared in a module rules named ‘OptitrackLiveLink’ in UE5Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. This type must derive from the ‘ModuleRules’ type defined by Unreal Build Tool.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command “C:\UE_5.1\Engine\Build\BatchFiles\Build.bat Studio_BaseTemplateEditor Win64 Development -Project=“C:\Users\User\Desktop\Studio_BaseTemplate\Studio_BaseTemplate.uproject” -WaitMutex -FromMsBuild” exited with code 6.
1>Done building project “Studio_BaseTemplate.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I can see that you were able to enable both plugin and run the project fine on your end. What I am doing wrong?
It could be a bad cache file from after the conversion.
I would suggest deleting the following folders:
.vs
Binaries
DerivedDataCache
Intermediate
Saved
And then re-generating the project (right cliick the icon with the blue unreal logo and pick generate visual studio project)
I specifically changed the engine version to 5.1 in OptitrackLiveLink.uplugin and OptitrackNatnet.uplugin so the error should not show up.
I’m not sure if the UE5Rules error isn’t something specific to visual studio 2019 and how it interprets the compile headers. I’ve switched to 2022 for some time and rarely go back to it.
I’ll try a recompile on 2019 and I’ll check if it throws the same error
edit: seems unreal automatically compiles it for 2022 in my case. Cannot downgrade the generate process
If I hit Re-Build instead of Build in VS2019. I still get the message below but not the error and the build succeed.
1>Expecting to find a type to be declared in a module rules named ‘OptitrackLiveLink’ in UE5Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. This type must derive from the ‘ModuleRules’ type defined by Unreal Build Tool.
However when I try to launch the project I still get:
“The following modules are missing or built with a different engine version:
OptitrackLiveLink
OptitrackNetnat
Engine modules cannot be compiled at runtime. Please build through your IDE”
I am trying to install VS2022 and see if it changes anything.
If the problem persists I can pack you the whole project and you can test it out with 2022 later on.
It’s very basic and you can check if it compiles & runs with no errors on your end.
If you are compiling the game from visual studio it is responsible for building the binaries folder (it contains binary files that are the outcome of the project compiling). I will upload a full version of the project soon.
Link to full project
Unpack => right click unreal project file => Generate Visual Studio project" => run project file in visual studio => compile project and wait for the editor to run.
Also make sure you have the correct source selected (pick switch unreal engines and point engine built from 5.1 source)
In visual Studio, what should be the solution config? Development Editor, development, Shipping?
Edit:
Ok It compiled without issue and was able to start the project.
I did have a warning at startup saying that the map couldn’t be loaded because it was done with a more recent version of the engine…
I am using 5.1 preview1. Are you running 5.1 preview 2?
Could this be the issue?
After reinstalling UE 5.1 and VS I finally got the project to compile. And the plugin seems to work fine.
Thanks a lot for your support and sending the different files!