Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Building plugin fails when declaring a delegate, rebuilding or recompiling from editor works

The context

I have declared a delegate in a class header of a plugin and there is nothing wrong there.

The issue

But I cant build my code from Visual studio. Rebuilding from Visual Studio works fine, but when I build, the UBT fails silently (without any error message. It just says "couldnt produce item..."). If I recompile the plugin from the editor's module window, it compiles nicely but building from Visual Studio fails as soon as I make a change in my source code.

Why cant I build from Visual Studio when I declare delegates, but have to recompile from the editor instead? Sounds like a bug to me.

Product Version: UE 4.15
more ▼

asked Mar 19 '17 at 09:25 AM in Bug Reports

avatar image

151 5 11 14

avatar image Doug E ♦♦ STAFF Mar 20 '17 at 01:03 PM

Hey rYuxq-

If I understand correctly, once you add the delegate to your plugin, you then get compile errors if you compile inside Visual Studio but don't get compile errors if you compile from the editor, correct?

Something to note, plugin code does not get compiled in a hot reload (compiling from the editor or through VS with the editor open). When you compile from the editor it does not check the plugin code and instead only compiles the game code.

If you're getting errors compiling inside Visual Studio, please provide the full error message as well as the code you're using that is causing the compile to fail.

avatar image rYuxq Mar 20 '17 at 05:36 PM

I didnt use the recompile button for the game code. I used the recompile button for modules (the one for my plugin, to be precise) from Window > Developer Tools > Modules.

Btw, the build from VS works (when I have declared delegates) if I close the editor before. As for the error message... There is none, it just says that it couldnt produce the item. I will see if I can provide an example project

avatar image Doug E ♦♦ STAFF Mar 22 '17 at 01:46 PM

When I create a new project and add a plugin to it, I'm able to compile using both the module compile button and directly inside VS. Can you provide the code you're using for your plugin? Specifically, how are you declaring/using your delegate. Being able to match the setup you're using should help me identify what is going on.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I cant seem to reproduce this error with a new project and plugin as well... It might be that I am getting that error with my project and plugin because I have been migrating it across multiple engine iterations... I have no clue. The setup for my existing plugin was simple: I have a component and I needed to add delegates to it. So I properly declared a delegate right above its class definition (above the UCLASS...). But when I tried to build it while my project was open in the editor, it failed silently. There was no error message. the UBT only said it couldnt produce the item. But if I tried to rebuild my project with the same setup instead, it didnt fail. It didnt fail either when I recompiled the plugin from the Modules window.

Unfortunately, I cant provide my project and plugin. I think, we can mark this as solved for the time being... Until I come up with a report that is more precise. Do you agree?

more ▼

answered Mar 22 '17 at 03:09 PM

avatar image

151 5 11 14

avatar image Doug E ♦♦ STAFF Mar 22 '17 at 04:01 PM

Hey rYuxq-

If you're able to reliably reproduce the issue in a new project, feel free to comment here to reopen the post. For the time being I will mark this as resolved for tracking purposes.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question