Announcement

Collapse
No announcement yet.

Call another plugin's static function in my own plugin problem

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Call another plugin's static function in my own plugin problem

    I need to call another plugin's static function in my own custom plugin with C++ code, the project can compile, but occured link error, can't access another plugin from one plugin in unreal?

    #2
    It's not recommended but it is possible, so long as the other plugin has exported the function. In the .h where the function is declared, it needs to be preceded with OTHERPLUGINMODULENAME_API.

    If that's the case, you need to include that header from your plugin, and also add the following to your plugin's build.cs file.
    Code:
    PublicDependencyModuleNames.Add("OtherPluginModuleName");

    Comment


      #3
      Originally posted by kamrann View Post
      It's not recommended but it is possible, so long as the other plugin has exported the function. In the .h where the function is declared, it needs to be preceded with OTHERPLUGINMODULENAME_API.

      If that's the case, you need to include that header from your plugin, and also add the following to your plugin's build.cs file.
      Code:
      PublicDependencyModuleNames.Add("OtherPluginModuleName");
      Is "OTHERPLUGINMODULENAME_API" an actual thing? If not could you have provide example code for the header file (.h file)?

      Edit: Never mind. The solution that was not included here was to #include the other plugin's header, i.e. :
      Code:
      #include "OtherPluginModuleName.h"
      should do the trick in theory. Have to test yet.
      Last edited by Avelworldcreator; 03-10-2017, 05:38 PM.

      Comment


        #4
        Not really, have to do like he said; include the module in Build.cs than include in your header the .H of the function you want to call.
        The plugin must export the function.
        (a plugin may have several header files)
        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment

        Working...
        X