Jump to content

  • Log In with Google      Sign In   
  • Create Account

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: 314

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: 15576

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
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#3 Orangeatang   Members   -  Reputation: 1856

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