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"

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

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!

Product Version: UE 4.19
Tags:
more ▼

asked Jan 21 '19 at 12:27 PM in C++ Programming

avatar image

DaKenpachi
79 5 6 11

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

1 answer: sort voted first

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 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.

more ▼

answered Jan 23 '19 at 10:36 PM

avatar image

Przemek2222
431 4 10 14

avatar image DaKenpachi Jan 24 '19 at 11:46 AM

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)^^

(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