Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

Templates in VS2012 ?

This topic is 1470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

 

I've never used STL or templates in my C++ programs so excuse my ignorance. I'm using an SDK (the Autodesk FBX SDK) and it has a function with a template (if that's the right terminology.)

 

When I use it:

 

int count=pScene->GetSrcObjectCount<FbxAnimStack>();

 

...it compiles just fine but I get this error when it links:

 

error LNK2001: unresolved external symbol "public: static class fbxsdk_2015_1::FbxClassId fbxsdk_2015_1::FbxAnimStack::ClassId" (?ClassId@FbxAnimStack@fbxsdk_2015_1@@2VFbxClassId@2@A)

 

Do I have to set up anything in my project to use templates ?

 

Thanks a lot.

 

Share this post


Link to post
Share on other sites
Advertisement
I don’t have my code with me but that is not the way to get properties anymore since 2015.1.
Look at the samples. Since I don’t have anything with me, I can only give a generalized answer, but there should be a specialized method to get the animation stack, such as GetAnimationStack().


L. Spiro

Share this post


Link to post
Share on other sites

Templates are a feature of the C++ language, so you don't have to to anything to set them up... debugging the error messages can be confusing though smile.png

 

I don't know much/anything about Autodesk's SDK, but have you made sure that you are linking your project to their static library (.lib) files?

 

L. Spiro is spot on with the interface changes... to get the count for a particular object type you should use :

FbxScene::GetMemberCount( const FbxCriteria &pCriteria ) const

So you fill in an FbxCriteria instance with the type of object that you're looking for... in your case FbxAnimStack:

FbxCritera searchCriteria = FbxCriteria::ObjectType( FbxAnimStack::FbxClassId )

Here's a link to the documentation, the GetMemberCount is part of the FbxCollection class, which FbxScene is derived from :

 

http://help.autodesk.com/view/FBX/2015/ENU/?guid=__cpp_ref_class_fbx_scene_html

 

Hope that helps!

Edited by Orangeatang

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!