Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Templates in VS2012 ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Endemoniada   Members   -  Reputation: 370

Like
0Likes
Like

Posted 06 July 2014 - 02:38 PM

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.

 



Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 21429

Like
1Likes
Like

Posted 06 July 2014 - 03:05 PM

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

#3 Orangeatang   Members   -  Reputation: 2416

Like
0Likes
Like

Posted 07 July 2014 - 02:39 AM

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, 07 July 2014 - 03:07 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS