How to manually build plugins?

I am trying to use a plugin ( Release VaRest 1.1-rc9 · ufna/VaRest · GitHub ) that was compiled for UE 4.9; my project is done in UE 4.11. When I try to open the project, it treis to rebuild the plugin, but it fails and it tells me to rebuild it manually.

Question is, how can I build a plugin? I tried following the documentation (Plugins in Unreal Engine | Unreal Engine 5.1 Documentation ), but I’m stuck at point 3: Rebuild your C++ project files … how to do that? The documentation is not really clear about this…

If I try with csc (using a command line like

csc /t:library /out:VaRestPlugin.dll VaRestPlugin.Build.cs,

I get as a response:

VaRestPlugin.Build.cs(7,30): error CS0246: The type or namespace name 'ModuleRules' could not be found (are you missing a using directive or an assembly reference?)

How do I specify the assembly reference? If I try with something like

csc /t:library /r:ModuleRules.dll /out:VaRestPlugin.dll VaRestPlugin.Build.cs

of course I get as a response

error CS0006: Metadata file 'ModuleRules.dll' could not be found

If I try instead to import the project into Visual Studio, of course it cannot find the includes like Engine.h, CoreUObject.h, etc.

Also, reading the Build.cs of that particular plugin, I’ve seen that it’s getting a ThirdPartyPath:

private string ThirdPartyPath
{
    get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
}

I see that there are a lot of ThirdParty subdirectories under the Engine directory. Which one is the correct one? Do that means that I have to put the plugin somewhere inside the Engine directory, in order to manually build it?

First of all, make sure you’ve followed all of these steps from the plugin’s wiki: GitHub - ufna/VaRest: REST API plugin for Unreal Engine 4 - we love restfull backend and JSON communications!

If you want to rebuild the plugin, which you probably have to since you’re on a different engine version, you’ll have to do the thing where they suggest to copy the VaRest project into YourProject/Plugins/VaRestPlugin folder instead of downloading the pre-compiled version


Now, for rebuilding the plugin, try this:

  • Close UE4
  • Manually delete the “Intermediate” and “Binaries” folders of the plugin, if they are present (directly in windows explorer)
  • (Optionnal) Manually delete the “Intermediate” and “Binaries” folders of your actual game project. This will cause your game modules (non-plugin) to be rebuilt too
  • (Optionnal) Right-click your .uproject file (in windows explorer), and click “Generate Visual Studio Project Files”
  • Double-click on your .uproject file to launch UE4. You should see a popup telling you that some modules need to be rebuilt. Accept.

This should rebuild your plugin. The stuff I tagged as (Optionnal) should be unrelated to rebuilding your actual plugin, but I sometimes end up doing these steps just to be sure.

If the build fails, the log file detailing the errors is under “YourProject/Saved/Logs/YourProject.log”. We’ll probably need the contents of this log file if this doesn’t work. Good luck!

1 Like

Thank you, the rebuilding procedure worked.

And in case of Blueprint based project? At the start of the project it doesn’t offer any rebuilding.

Edit: For others, who wonder: make a new C++ project just for this, copy in the plugin, and do these steps, then copy the plugin to your new project.

But this is rebuilding all plugins inside the project folder. How can I make it build only changed plugins?

Thanks :slight_smile:

For pure Blueprint project, just add empty C++ class from File menu. Then put plugin folder without Binaries file and next time when you load, it would recompile the plugin.

Unfortunately, when I do this it insists that I have Visual Studio 2015 installed.

Unfortunately, I can’t have VS2015 because it insists on putting several dozen gigabytes of stuff on my system drive (even though I tell it to install on another drive) which, because it’s an SSD, doesn’t have enough space.

BTW the output from the UBT (including errors) is sent to Project/Saved/Logs/[ProjectName].log.

Don’t delete unchanged plugin binaries.

I found that creating an empty C++ project, plus adding whatever plugins I wanted to build

I have a similar issue, I followed the steps in this thread and still get a build failure. I am trying to build a plugin from integration source. I can post my log if anyone is available to help, could really use the assistance. :slight_smile:

The error has to do with missing modules of my plugin, and for the life of me I don’t know how to address the issue.