x

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"

[C++] Circular Dependencies in plugin modules

Hello!


I'm making a plugin with 2 modules, which have to "cooperate" with each other (some of .cpp files include classes from another module and vice versa). My asset class created inside Runtime module need some data from Editor module. In other hand, my AssetTypeAction class declared inside Editor module need my asset class.

When I want to include some file from another plugin,I just add module name to DependencyModuleNames inside ModuleName.Build.cs. Unfortunately, when I did the same thing inside my second module build file,

 EXEC : error : Action graph contains cycle!

.. appears.

Anyone know how to solve this?

Product Version: UE 4.13
Tags:
more ▼

asked Sep 06 '16 at 09:04 PM in C++ Programming

avatar image

MRCookie
60 10 14 21

avatar image Cloudy McStrife Sep 06 '16 at 10:54 PM

Hey Mr. Cookie Try it with forward declaration.

If you need a specific Object in a .h you can instead of

 #include "SomeObject.h"

use

 class SomeObject;

This means that you forward declared this Object. But beware that it is an incomplete type then. (You cannot use the functions provided by "SomeObject") IF you want a complete type in your .cpp you can include it there.

Greetings Cloudy

avatar image BrUnO XaVIeR Sep 07 '16 at 03:00 AM

Never reference anything from Editor modules inside of Runtime plugins. You will break packaging for all games using your plugin.

avatar image MRCookie Sep 08 '16 at 04:46 PM

My structural problem is a bit different (or maybe not). Inside Editor module I created classes that modify my asset ( Graph Editor, nodes to grah, graph scheme etc.), but I don't need such classes during runtime. All methods using graph data are separated by #if WITH_EDITOR.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I'm having the same problem.

Did you find a solution?

more ▼

answered Nov 04 '16 at 07:23 PM

avatar image

Acu43
41 3 5

(comments are locked)
10|2000 characters needed characters left
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