Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding AURTrackingComponet to Custom Class in C++ #17

Open
chipper10 opened this issue Jan 26, 2018 · 4 comments
Open

Adding AURTrackingComponet to Custom Class in C++ #17

chipper10 opened this issue Jan 26, 2018 · 4 comments

Comments

@chipper10
Copy link

Hello,

Thank you very much for the plugin, I am able to load the example projects and it works well.

The next I wanted to do was create a new C++ class "Trackable Object" that already comes with the proper mesh and tracking target. I want to do this so I can generate the objects on the fly later.

What is the proper method to add the AURTrackingComponent to a C++ class?

CreateDefaultSubobject gives me a linker error. I've tried a few other things to no avail.

Is it possible to do this and what's the best way?

Thank you

@adynathos
Copy link
Owner

Please try adding "AugmentedUnreality" to PublicDependencyModuleNames in YourProject.Build.cs.
It may cause the plugin to be used in C++ linking.

@chipper10
Copy link
Author

Thanks for the response. I had to do this to get it to compile so that was already done. Somehow the linker still throws an error. So have you successfully been able to create an object of type AURTrackingComponent in C++ before? Can you share the code you used if so? Thank you!

@adynathos
Copy link
Owner

Could you post the linker error message here? Which symbols are missing?

@chipper10
Copy link
Author

chipper10 commented Jan 29, 2018

This is the code I'm using:
UAURTrackingComponent* trackingComponent;
trackingComponent = CreateDefaultSubobject<UAURTrackingComponent>(TEXT("Tracker"));

and here is the linker message:
Error LNK2019 unresolved external symbol "private: static class UClass * __cdecl UAURTrackingComponent::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@UAURTrackingComponent@@CAPEAVUClass@@XZ) referenced in function "public: __cdecl ATrackable_Part::ATrackable_Part(void)" (??0ATrackable_Part@@QEAA@XZ) AugmentedUnrealityEx C:\Users\keselmld\Documents\Projects\AugmentedUnrealityEx\Intermediate\ProjectFiles\Trackable_Part.cpp.obj 1
As I understand it, the CreateDefaultSubobject template calls UAURTrackingComponent::GetPrivateStaticClass(void) as part of the creation process and this function does not exist. Let me know if I'm misunderstanding.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants