# 'Unresolved external symbol' calling a static function from a plugin

**URL:** <https://forums.unrealengine.com/t/unresolved-external-symbol-calling-a-static-function-from-a-plugin/441757>\
**Category:** Plugins\
**Tags:** library, ufunction, unreal-engine, Plugins, CPP, question\
**Created:** [January 21, 2019, 12:27pm UTC](https://forums.unrealengine.com/t/unresolved-external-symbol-calling-a-static-function-from-a-plugin/441757 "2019-01-21T12:27:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_c3e69a5a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c3e69a5a](https://forums.unrealengine.com/u/anonymous_user_c3e69a5a)\
**Post date:** [January 21, 2019, 12:27pm UTC](https://forums.unrealengine.com/t/unresolved-external-symbol-calling-a-static-function-from-a-plugin/441757/1 "2019-01-21T12:27:56Z")

</div>

Hi,

I have a plugin (from Stereolabs to access a stereocamera in unreal) and another one to access the PointCloudLibrary (pcl).

In an Actor class in my game I want to access a static method I wrote in the Stereolabs plugin:  
`static ESlRetrieveResult GetPointCloudAtRoi(FBox2D ROI, pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & PointcloudOut, float MinConfidence = 0, float MaxConfidence = 100);`

I cannot make this a UFunction, because the Pointcloud Pointer is not known by unreal. But as it is a public static method I should be able to access it like this:

```
bool AZedPointcloudFactory::GetPointcloudFromZED(FBox2D ROI)
{
	ESlRetrieveResult result = UZEDFunctionLibrary::GetPointCloudAtRoi(ROI, Pointcloud, MinConfidence, MaxConfidence);
	return result == ESlRetrieveResult::RR_RetrieveValid;
}

```

But when I try to compile, i get this error:

> unresolved external symbol “\_\_declspec(dllimport) public: static enum ESlRetrieveResult \_\_cdecl UZEDFunctionLibrary::GetPointCloudAtRoi(struct FBox2D,class boost::shared\_ptr \> &,float,float)” …

I did include the Plugin Modules in my Game.Build.cs and when I call another static Method (being a UFunction this time) from the UZEDFunctionLibrary, everything is fine.

Do you know if this is because one is a UFunction and the other one isnt? Or what else could case this issue?  
Thanks for any help!

---

<div class="post-metadata">

**Author:** ![Przemek2222](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Przemek2222](https://forums.unrealengine.com/u/Przemek2222)\
**Post date:** [January 23, 2019, 10:36pm UTC](https://forums.unrealengine.com/t/unresolved-external-symbol-calling-a-static-function-from-a-plugin/441757/2 "2019-01-23T22:36:16Z")

</div>

Hello,

I don’t know what are this functions but you might didn’t included file with this function (GetPointCloudAtRoi()) or you may did some mistake in declaration. First check where GetPointCloudAtRoi() is then include this file. Next check where do you have your enum ESlRetrieveResult declaration include this one (if it’s another file) too.

Error you get is explict. Compiler can’t found definition for static enum ESlRetrieveResult. (Or GetPointCloudAtRoi())

According to [Call another plugin's static function in my own plugin problem - C++ Programming - Unreal Engine Forums](https://forums.unrealengine.com/development-discussion/c-gameplay-programming/88314-call-another-plugin-s-static-function-in-my-own-plugin-problem)

you should add PublicDependencyModuleNames.Add(“OtherPluginModuleName”); to your plugin’s build.cs file.

What do you need two different plugins for? It’s not recomended.

If you will still have problem then comment please.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c3e69a5a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c3e69a5a](https://forums.unrealengine.com/u/anonymous_user_c3e69a5a)\
**Post date:** [January 24, 2019, 11:46am UTC](https://forums.unrealengine.com/t/unresolved-external-symbol-calling-a-static-function-from-a-plugin/441757/3 "2019-01-24T11:46:40Z")

</div>

Hey,

Thanks for your reply. I fixed it, though it wasn´t what you and I thought it´d be.

First of all, it wasn´t a missing include. Because with a missing include, you dont get an **unresolved external symbol** , because the symbol itself cant be known then, so you would get a **unkown identifier**.

It also wasn´t a missing DependencyModule int the Build.cs, although I had experienced that modules aren´t always propagated through other modules.  
(e.g. module1 adds dependency on module2, which has dependency on module3. If module1 also needs classes from module3, it needs to add it explicitly as dependency…)

At last it was a code failure. I use Visual Studio community 2017, which has a really bad IntelliSense performance, which is why I sometimes write the implementation of a method without the “generate method definition in cpp” functionality of Intellisense. And I forgot the class declaration `UZEDFunctionLibrary::` before the `GetPointCloudAtRoi(...)` definition in the cpp file.

So the implementation of the method did not exist, which I did not recognize until I called it (if you dont call it, the compiler does not care whether a method has an implementation)^^

---

<div class="post-metadata">

**Author:** ![FrancoACT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FrancoACT](https://forums.unrealengine.com/u/FrancoACT)\
**Post date:** [July 4, 2023, 10:13pm UTC](https://forums.unrealengine.com/t/unresolved-external-symbol-calling-a-static-function-from-a-plugin/441757/4 "2023-07-04T22:13:09Z")

</div>

Hi! I had a similar problem, and in my case, I had all code correct, and the module name added to the .build file. I knew that should work, it did in another project, but I still have the **unresolved external symbol** error.

The problem was that the definition of the function (the body) was in the .cpp file, and in the other projects was in the .h file. Unreal required that, if the function was its body in the cpp file, the class must be marked as export and the macro NAMEOFMODULE\_API must be added before the class declaration. In my case:

```auto
UCLASS()
class CORECOMMONTOOLS_API UCoreCommonToolsBPLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_UCLASS_BODY()
...

```
