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?
Announcement
Collapse
No announcement yet.
Call another plugin's static function in my own plugin problem
Collapse
X
-
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");
-
Originally posted by kamrann View PostIt'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");
Edit: Never mind. The solution that was not included here was to #include the other plugin's header, i.e. :
Code:#include "OtherPluginModuleName.h"
Last edited by Avelworldcreator; 03-10-2017, 05:38 PM.
Comment
-
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)
Comment
Comment